Я получаю следующие ошибки при запуске моего кода и не уверен, с чего начать с отладки этого.
mapStateToProps() in Connect(EquipmentMetadata) must return a plain object. Instead received undefined.
Warning: Failed prop type: The prop name is marked as required in EquipmentMetadata, but its value is undefined.
Это индексный файл:
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> import 'babel-polyfill'
import React from 'react'
import { render } from 'react-dom'
// import Root from './containers/Root'
import { setName } from './actions'
// import createStore from './common/store/'
import { Provider } from 'react-redux'
import EquipmentMetadata from './containers/EquipmentMetadata'
// import ReduxPiece from './components/ReduxPiece'
import configureStore from './configureStore'
const store = configureStore()
window.EquipmentMetadata = {
store,
setName
}
render(
<Provider store={store}>
{/* <Root /> */}
<EquipmentMetadata />
</Provider>,
document.getElementById('equipment-metadata')
)
import 'babel-polyfill' import React from 'реагировать' import {render} из'act-dom '// импортировать Root из' ./containers/Root 'import {setName} из' ./actions '// импортировать createStore from'./common/store/' import {Provider} из'act-redux 'import EquipmentMetadata из' ./containers/EquipmentMetadata '// импортировать ReduxPiece из' ./components/ReduxPiece 'импортировать configureStore из "./configureStore" const store= configureStore () window.EquipmentMetadata = {store, setName} render ({/ ** /}, document.getElementById ('equipment-metadata')) equipmentmetadata.js import React, {Component} из 'response', импорт PropTypes из 'prop-types', импорт {connect} из'act-redux ', импорт Приветствие из'../components/Greeting '// импортировать ReduxPiece из "../components/ReduxPiece";class EquipmentMetadata extends Component {render () {// const {name} = this.props return (
{/ ** /}
)}} EquipmentMetadata.propTypes = {name: PropTypes.string.isRequired} функция mapStateToProps (state) {// const {name} = state // вернуть {// name //}} функция mapDispatchToProps (отправка) {return {}} экспортировать соединение по умолчанию (mapStateToProps, mapDispatchToProps) (EquipmentMetadata)