Setting Up App.js
To complete the setup and run the chart, we need to call the TVChartContainer
component inside the main App.js
file. Here's the process:
1. App.js
import "./App.css";
import TVChartContainer from "./TVChartContainer";
function App() {
return (
<div className="App">
<TVChartContainer />
</div>
);
}
export default App;
- App.js: This is the entry point of your React app. It imports the
TVChartContainer
component, which encapsulates the TradingView chart logic. The component is rendered inside adiv
with the classApp
.
2. Run the Application
Now that you have set up App.js
, you can run the application using the following command:
npm start
This will start the development server, and your TradingView chart with both historical and real-time OHLC data should now be visible.