I've been able to render in several different ways a component in React, However, I'm not sure what is actual difference between rendering like this:
App.js (sample cut):
import Cartesian from './cartesian'
//Somewhere inside the App.js component:
<div id="graph">
<Cartesian/>
</div>
Cartesian.js:
export default class Cartesian extends Component {
render() {
return <h1> Ex </h1>
}
}
Now this works perfectly, However, I'm not sure about the difference if I had add something linke this:
import Cartesian from './cartesian'
//Somewhere inside the App.js component:
<div id="graph">
<Cartesian/>
</div>
ReactDOM.render(<Cartesian/>,document.getElementById("graph"));
Or even this:
import Cartesian from './cartesian'
//Somewhere inside the App.js component:
<div id="graph">
</div>
ReactDOM.render(<Cartesian/>,document.getElementById("graph"));
Rendering-wise, does any of these has any difference? I have read some about React DOM from both API and this useful post (React vs ReactDOM?) However, this subject is not quite clear for me when it comes to rendering.
Thanks in advance.