react-redux-form
react-redux-form copied to clipboard
Native version requires react-dom
import { Form } from 'react-redux-form/native';
requires also react-dom... becouse imports some code from src/index.js what import dom-based control...
Version: [email protected]
The only instance I could find is here:
const findDOMNode = !isNative
? require('react-dom').findDOMNode
: null;
Are you sure you can't use this without react-dom?
I upgrade my old project. At now packager say...
Unable to resolve module `react-dom` from `/home/alexes/projects/myfresh/native-client/node_modules/react-redux-form/lib/components/control-component.js`: Module does not exist in the module map or in these directories:
/home/alexes/projects/myfresh/native-client/node_modules
, /home/alexes/node_modules
[email protected] The project skeleton generated today.
I'm also getting this error. If I'm interpreting the line correctly, it's saying "If it is web, require react-dom, if not, don't. I'll try replacing it with just findDOMNode = null.
Yeah that worked. Had to restart Expo from scratch, but it worked. Literally just replace this line like this, it seems something is getting required when in needn't be:
// var findDOMNode = !_isNative2.default ? require('react-dom').findDOMNode : null;
var findDOMNode = null;
I'll make a fix for that.
I'm getting the same error as @alexesDev using [email protected]
This still seems to be very much an issue.
I got around it by commenting out line 26 & line 36 of the control-component.js.
Then adding: findDOMNode: null after line 36.
It looks like pull request 101d3bd that was meant to fix the issue wasn't successfully merged, are the plans to address this?
@nextriot would you be able to make a new PR for it? I can merge it in ASAP.
@davidkpiano the changes that I've made would be destructive to the rest of the project (e.g. the web side).
The issue seems to be the static analysis of 'require' statements. Just the fact that it's present in the control-component.js file is forcing the compiler to search for the component. It doesn't make a difference if the 'require' is made conditionally or not, the compiler will always do the lookup.
The fastest way I can see around it is by having a separate control-component.js file for React Native use only. Alternatively, there may be a conditional require plugin for react that you could include as a dependency then use the 'require' statement as is with minimal tweaking.
I don't know enough about the layout of the plugin yet to implement either fix however. Sorry.
Let me know if there's anything else I can help with. If you want me to make the PR regardless of the above, just say the word.
Having this issue too with version 1.16.6
You can work around this: https://remarkablemark.org/blog/2017/02/25/webpack-ignore-module/