redux-autoform / redux-autoform-bootstrap-ui

Bootstrap UI extension for redux-autoform
https://redux-autoform.github.io/redux-autoform-bootstrap-ui/demo.html
MIT License
6 stars 11 forks source link

EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React. #49

Open SarjuHansaliya opened 8 years ago

SarjuHansaliya commented 8 years ago

I am facing this issue when I uncomment following line.

import { EditComponentFactory } from 'redux-autoform-bootstrap-ui';

Here is my package.json

"dependencies": {
    "react": "^15.3.2",
    "react-native": "^0.33.0",
    "react-redux": "^4.4.5",
    "react-select": "^1.0.0-rc.2",
    "redux": "^3.6.0",
    "redux-autoform": "^0.10.0",
    "redux-autoform-bootstrap-ui": "^1.7.1-experimental",
    "redux-form": "^6.0.2",
    "tcomb-form-native": "^0.6.1"
  },
  "devDependencies": {
    "babel-cli": "^6.14.0",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-jason": "^1.0.1",
    "babel-preset-react": "^6.11.1",
    "babel-preset-react-hmre": "^1.1.1",
    "babel-preset-stage-0": "^6.5.0",
    "grunt": "^1.0.1",
    "grunt-tslint": "^3.2.1",
    "tslint": "^3.15.1",
    "typescript": "^1.8.10",
    "typings": "^1.3.3"
  }

And here is my imports in main file.

import React,{ Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TextInput,TouchableHighlight
} from 'react-native';
import {AutoForm} from 'redux-autoform';
import { EditComponentFactory } from 'redux-autoform-bootstrap-ui';

Can you help me what might be the issue?

JonatanSalas commented 8 years ago

Tell me a bit of how you have congifured your enviroment? Do you use webpack, I answer this because I see you are using resct-native. I'm thinking why this trouble could be happen, and then I remember that in the redux-autoform package.json react is included as a dependency and not as a devDependency. So, may be, when you try to use the EditComponentFactory this component wants to use its own react version, but you have added one, resulting on this error.

Probe the following, in your node_modules localize the redux-autoform-bootstrap-ui package. Then, inside this package, delete from the package node_modules react. And run it again, with that we could see if the problem it's related to what I tell you before.

Let me know if this help you!

andrerpena commented 8 years ago

Also, we current don't support Redux Form 6. We're still adding support. We should probably do something so it will trigger an unmet peer dependency error

SarjuHansaliya commented 8 years ago

@JonatanSalas No I am not using webpack.I am using direct grunt and typescript combination. But I didn't get your "in your node_modules localize the redux-autoform-bootstrap-ui package. Then, inside this package" point. Can you elaborate?

SarjuHansaliya commented 8 years ago

Also I checked that in "redux-form 6.0.2" package.json , react is in devDependencies.

JonatanSalas commented 7 years ago

@SarjuHansaliya we don't support yet redux-form v6. Redux-Autoform is based on Redux-form version 5.3.0. Try moving the 6.0.2 version to 5.3.0, reinstall and test it!