Using the-graph as a React component in a webpack environment
See original GitHub issue(Dev without much front-end experience here, sorry for any imprecision)
I read through the existing issues and saw there is the intention of stripping this project of noflo-specific dependencies and Polymer. But I have one question: as it is now, can the-graph
be used as a React component in a Webpack/CommonJS modules environment at all?
I tried creating a simple project just to see if I could use one of the React components, but just rendering this:
import React from "react";
import TheGraph from "the-graph/dist/the-graph";
console.log(TheGraph);
const TestComponent = () => (
<h1>Hello world!</h1>
);
export default TestComponent;
Causes an Uncaught ReferenceError: React is not defined
here. Does this happen because you are still in the process of migrating the code base to use CommonJS modules? Or am I doing something wrong? If it’s the former reason, is there any hack I can do to make this work?
Thanks for your work until now on this project, these graphs surely look great!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:19 (7 by maintainers)
Top GitHub Comments
Here is an example App.js that works out-of-the-box with
create-react-app
:Closing this as fixed
Screenshot of how above example should look:
The test app was actually using 16.2.0 (default in create-react-app). The very basics seems to work OK there, but React 15.6 will probably be the recommended/supported version for now. Compatibility fixes for React 16 that also works on 15.6 very welcomed!