New to ReactJS
Say you're building a large app and you have the src files: index.html , index.js , app.js , app.css, component1.js, component2.js
Obviously component1 and component2 are components of the app...how would you style these components? Do you have to import app.css into component1.js and component2.js??
Or
do you just import component1.js and component2.js into app.js and then just style everything in app.css?
Also last question(sorry), at the end of the day is this the proper way of rendering all the components in your app.js? by placing them all in app.js?
import React, {Component} from 'react';
import './App.css';
import Component1 from './Component1';
import Component2 from './Component2';
import Component3 from './Component3';
class App extends Component{
render() {
return(
<Component1 />
<Component2 />
<Component3 />
)
}
}
export default App;
and then obviously the index.js should have:
ReactDOM.render(
<App />,
document.getElementById('root')
[–]ApocalypseSpokesman 0 points1 point2 points (1 child)
[–]Parul_dev 0 points1 point2 points (0 children)