I have just started to learn react JS .And so I just wanted to know whether we could render elements from multiple JS files into the root node in React JS ? If Yes then how & if no then why?
For example, I was trying to do this
In index.js
import React from 'react';
import ReactDOM from 'react-dom';
import 'bootstrap/dist/css/bootstrap.css';
import Counter from './components/counter';
const x="one";
const y=<div><h2>Zero, {x}</h2><h1>{x=="one"?"two":"three"}</h1></div>
ReactDOM.render(y,document.getElementById('root'));
In one.js
import react from 'react';
import React from 'react';
import ReactDOM from 'react-dom';
const a="def";
const b="abc {a}";
ReactDOM.render(b,document.getElementById('root'));
But the output in the browser was just
Zero, one two