redux-form-utils icon indicating copy to clipboard operation
redux-form-utils copied to clipboard

这个还能用吗

Open XueMary opened this issue 7 years ago • 9 comments

为什么我看react深入技术栈的时候,用到的redux-componble-fetch和redux-form-utils都不行呢。

XueMary avatar Oct 21 '17 07:10 XueMary

具体遇到什么问题?

jasonslyvia avatar Oct 21 '17 11:10 jasonslyvia

redux-form-utils: TypeError: Cannot read property 'object' of undefined

`import React,{Component} from 'react'; import { createForm } from 'redux-form-utils';

@createForm({ form:'my-form', fields:['name', 'address', 'gender'], })

class Form extends Component {

render(){

const { name, address, gender } = this.props.fields;

return (
  <form className='form'>
    <div>
      <label htmlFor="firstName">First Name</label>
      <imput name='name' {...name} />
    </div>
  </form>
)

} }

export default Form;`

XueMary avatar Oct 21 '17 13:10 XueMary

redux-componble-fetch: 事件派发是成功的,但是数据在action中没返回,我看你写的是action.payload.articleList 我把action打印出来console.log(action) 并没有找到返回的数据

XueMary avatar Oct 21 '17 13:10 XueMary

错误的完整堆栈贴一下吧,或者最好能把完整的代码做一个可复现的 repo,从你目前提供的信息看不出问题在哪里

jasonslyvia avatar Oct 22 '17 04:10 jasonslyvia

git clone https://github.com/XueMary/utils-and-fetch.git

yarn insatll

cd mock

yarn run mock //启动数据 json-server

cd ..

yarn start

里面加载了 redux-componble-fetch 和 redux-form-utils 感谢你的帮助

XueMary avatar Oct 22 '17 06:10 XueMary

粗看了一下,是因为标签名拼错了? https://github.com/XueMary/utils-and-fetch/blob/6f77740355d22b37711475ac2b8435758e518229/src/components/Form/Form.js#L19

jasonslyvia avatar Oct 23 '17 02:10 jasonslyvia

不不不,修改后依旧是错误的

XueMary avatar Oct 23 '17 02:10 XueMary

@XueMary 你的问题解决了吗?我也遇见了这样的问题

giscrazier avatar Nov 29 '17 09:11 giscrazier

同样的问题报错,在这个地方提示 Cannot read property 'object' of undefined ReduxForm.propTypes = { form: _react.PropTypes.object };

947133297 avatar Dec 15 '17 02:12 947133297