-
-
Notifications
You must be signed in to change notification settings - Fork 349
Don't require react-dom #42
Comments
Cool :) Could you check whether |
That produces the same problem since it instead of
|
Ok, I'll setup a "mobx-react/no-dom" build in the next few days. In the Op wo 27 apr. 2016 om 20:07 schreef Kasper Sandin <notifications@github.com
|
What I did to work around it was to just add an empty module named "react-dom.js" to node_modules. After that mobx was able to run fine! |
I just pushed a patch to master. Would you mind testing it by cloning this repo and after that, in your own repo, run |
It works fine! Thanks for the quick support! I'm not a big fan of patches being used this way though, but that's a question for another issue :). GG~ |
@mweststrate can you explain in more details what should I do in order to eliminate this problem? The error comes from this line: I tried using: |
using /custom is the correct approach.After that your stacktraces should
mention `mobx-react/custom.js` not `index.js`. If that is still the case,
you are still referring to the wrong variation somehow
Op zo 3 sep. 2017 om 10:24 schreef Nir Yosef <notifications@github.com>:
… Can you explain in more details what should I do in order to eliminate
this problem?
Im getting:
webpackHotDevClient.js:233 Error in ../test/~/mobx-react/index.js Module
not found: 'react-dom' in /Users/niryo/git/test/node_modules/mobx-react
The error comes from this line:
@ ../test/~/mobx-react/index.js 2:116-136
I tried using: import { observer } from 'mobx-react/custom';
but it doesn't work.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhOqbhmIBH5c6I7mip9y4MkMiDoNXks5semJKgaJpZM4IRKvu>
.
|
@mweststrate What is the actually difference between the different renderers? |
From top of my head the main difference is dev tool integration, which uses
real dom nodes for highlighting. So custom should be safe in that case. But
you could asks advice to always use the standard, and set up a webpack
alias when targeting RN
…On do 7 sep. 2017 12:44 Nir Yosef ***@***.***> wrote:
@mweststrate <https://github.com/mweststrate> What is the actually
difference between the different renderers?
Is it only for development purpose? what will be the implications of using
mobx-react/custom.js?
Im building a library that would be used from both react and react-native
projects, and Im exposing mobx-react observer func.
what is the suggested way to do this? exposing observer from
mobx-react/custom?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhIHKC39FUUjs1PXzOOYyyAi3xGogks5sf8kEgaJpZM4IRKvu>
.
|
import { observer } from 'mobx-react/custom' Does work! Thanks! :) |
I use a custom react renderer that is not targeting the DOM thus I don't have the
react-dom
package in my project at all. This ends up giving me this error:Looking at
mobx-react/index.js
it doesn't look likereact-dom
is critical. How about making the package optional and permanently disabling your developer tools unless you have react-dom available?A future improvement could be to support devtools with an arbitrary react renderer.
The text was updated successfully, but these errors were encountered: