简体   繁体   中英

Can you use react-core without react-dom

So i've been reading the Facebook docs on React . There's a lot of it so I may of missed some however, I read that they're splitting React into react-core and react-dom .

I found this react-core repo: https://github.com/petehunt/react-core

I was wondering, has the split been made now? As in could I use react-core and implement another virtual-dom type library in place of react-dom ?

Yes, this split has happened as of React 0.14. The two official packages are react and react-dom , though they both still live in the facebook/react repository ; the DOM specific stuff is currently in ReactDOM.js while the shared stuff is exported from ReactIsomorphic.js . (This is internal, and when using the npm packages, you should just require("react") and require("react-dom") .)

There are already projects taking advantage of this split; take, for example, react-blessed , a custom renderer for the blessed library:

React Blessed Demo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM