I am a complete newbie with ReactJs or UI coding, in general. I have a single entry point in my ReactJs app - app.js
var React = require("react");
var ReactDOM = require("react-dom");
import Main from "./components/Main";
import Bucket from "./components/Bucket";
import Relay from "react-relay";
ReactDOM.render(<Main />,document.getElementById('react'));
ReactDOM.render(<Bucket />,document.getElementById('react-bucket'));
console.log(Relay.QL`query Test {ServerGroups {_id}}`);
I am trying to render the buckets.html page here :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RGR</title>
<script src="react-0.14.3.min.js"></script>
<script src="react-dom-0.14.3.min.js"></script>
</head>
<body>
<div id="react-bucket"></div>
<script src="bundle.js"></script>
<body>
</html>
When I go to the index.html page, everything renders fine. But when I go to the buckets.html page, I get a
Uncaught Error: _registerComponent(...): Target container is not a DOM element error
When i try to render just one element in app.js (comment out either the Main component render or the Bucket component render) , again, both components render fine. So there is no problem with the components themselves.
There is obviously a problem getting app.js read from both buckets.html and index.html. How can I access buckets.html and index.html in such a situation? Is it even possible?
Thanks!!