Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Aviod using React's internal modules #103

Open
dsblv opened this issue Oct 20, 2016 · 2 comments
Open

Aviod using React's internal modules #103

dsblv opened this issue Oct 20, 2016 · 2 comments

Comments

@dsblv
Copy link

dsblv commented Oct 20, 2016

Due to internal changes in upcoming React release, it's now unsafe to refer to React's internal modules.

Here's the error I get while using react-art@0.15.1 with react@15.4.0-rc.4:

Error in ./~/react-art/lib/ReactART.js
Module not found: 'react/lib/ReactInstanceMap' in C:\dev\chart\node_modules\react-art\lib

 @ ./~/react-art/lib/ReactART.js 22:23-60

Error in ./~/react-art/lib/ReactART.js
Module not found: 'react/lib/ReactMultiChild' in C:\dev\chart\node_modules\react-art\lib

 @ ./~/react-art/lib/ReactART.js 23:22-58

Error in ./~/react-art/lib/ReactART.js
Module not found: 'react/lib/ReactUpdates' in C:\dev\chart\node_modules\react-art\lib

 @ ./~/react-art/lib/ReactART.js 24:19-52

I'm open to help fixing it, just need some suggestions.

As far as I understand, React ART relies havily on React's internals:

const ReactInstanceMap = require('react/lib/ReactInstanceMap');
const ReactMultiChild = require('react/lib/ReactMultiChild');
const ReactUpdates = require('react/lib/ReactUpdates');
Is it possible to use any public APIs instead? Is it OK to just copy-paste required files directly into this project?

Maybe we have something to do here in preparation for new Fiber reconciler? I think I've heard somewhere that custom renderers will have to bring their own reconciler code when it lands…

✌️


Update

I noticed that React ART is also exists in React repo where this issue is irrelevant! Is it possible to pubish this package from there?

@sophiebits
Copy link
Member

The best solution here is to change these to import from react-dom. React ART already needs to live inside React DOM. The copy in the React repo is only for tests and this is the source of truth.

@dsblv
Copy link
Author

dsblv commented Oct 21, 2016

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants