Не удается прочитать свойство 'displayName' из неопределенного - PullRequest
1 голос
/ 08 мая 2019

У меня такая странная проблема в моем реактивно-родовом коде в форме редукса. что может быть решением для этого см. мои фрагменты кода, как показано ниже. это какая-то ошибка версии библиотеки? или ошибка в моем коде? я не нашел ошибок в своем коде.

Отладчик в Chrome:

Cannot read property 'displayName' of undefined
handleException @   ExceptionsManager.js:74
handleError @   setUpErrorHandling.js:23
reportFatalError    @   error-guard.js:42
guardedLoadModule   @   require.js:199
metroRequire    @   require.js:125
(anonymous) @   createValues.js:35
executeApplicationScript    @   debuggerWorker.js:40
(anonymous) @   debuggerWorker.js:72

Вот App.js

App.js

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import LoginForm from './LoginForm';
import store from './Store';

export default class App extends Component{
  render() {
    return (
      <Provider store={store}>
        <LoginForm />
      </Provider>
    );
  }
}

вот LoginForm.js

LoginForm.js

import React from 'react';
import { StyleSheet, Alert, TouchableHighlight, TextInput, View, Text } from 'react-native';
import { reduxForm } from 'redux-form'

const LoginForm = reduxForm({
  form: 'LoginForm'
})(MyFormComponent);

const MyFormComponent = () => {
  return (
    <View style={styles.container}>
      <Text style={styles.title}>Login</Text>
      <View style={styles.combineview}>
        <Text>First Name :</Text>
        <TextInput
          underlineColorAndroid="black"
          placeholder="First Name" />
        <Text>Surname :</Text>
        <TextInput
          placeholder="Surname"
          underlineColorAndroid="black" />
        <Text>Email :</Text>
        <TextInput  
          placeholder="Email"
          underlineColorAndroid="black" />
        <TouchableHighlight
          style={styles.button}
          onPress={() => Alert.alert('Button clicked')}>
          <Text> Add </Text>
        </TouchableHighlight>
      </View>
    </View>
  );
}

export default LoginForm;

Вот store.js

Store.js

import {createStore, combineReducers} from 'redux';
import {reducer as formReducer} from 'redux-form';

const mainReducer = combineReducers({
   form: formReducer
});

const store =createStore(mainReducer)
export default store;

Вот изображение ошибки

...