firtoz / react-three-renderer

Render into a three.js canvas using React.
https://toxicfork.github.com/react-three-renderer-example/
MIT License
1.49k stars 155 forks source link

Can't resolve 'react/lib/ReactComponent' #184

Closed IcanDivideBy0 closed 7 years ago

IcanDivideBy0 commented 7 years ago

Hi, Seems the react/lib/ReactComponent doesn't exists anymore. So i got this error thrown

./~/react-three-renderer/lib/React3Renderer.js
Module not found: Can't resolve 'react/lib/ReactComponent' in '.../node_modules/react-three-renderer/lib'

Is there any particular reason to import react's internals ? React.component is basically the same ?

$ yarn list react react-three-renderer
yarn list v0.24.5
├─ react-three-renderer@3.1.0
└─ react@15.6.1

Everything worked fine w/ react@15.5.4

kenta88 commented 7 years ago

I fixed this running npm install into node_modules/react-three-renderer

bcongdon commented 7 years ago

@kenta88's solution seems to work.

However, this has the annoying side effect of react-three-renderer's pre-commit hooks getting attached to your toplevel project 😕

toxicFork commented 7 years ago

This should be fixed with the 3.2.0 release which will support react@~15.6.1

toxicFork commented 7 years ago

Is there any particular reason to import react's internals ? React.component is basically the same ?

It was "the way to make your own renderer", at least until I finish the "react-three-renderer-fiber" : https://github.com/toxicfork/react-three-renderer-fiber ( no estimated time of arrival ™️ )

toxicFork commented 7 years ago

Please reopen if it still persists

tmulroy commented 6 years ago

Any chance someone can explain why cd into node_modules/react-three-renderer and running npm install fixes this?

toxicFork commented 6 years ago

It's because of package dependencies being strange in npm. It may cause other problems with react, but once the latest version support gets merged in it will be OK. The only problem is time :p

On Sat, Feb 3, 2018, 21:16 tmulroy notifications@github.com wrote:

Any chance someone can explain why cd into node_modules/react-three-renderer and running npm install fixes this?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/184#issuecomment-362854977, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLfcuFB17HyYKGdDxW6cRNSer2m88ks5tRMy4gaJpZM4OKSc2 .