redux-form

How to get Redux Form data in another Component

给你一囗甜甜゛ 提交于 2019-11-28 01:15:32
How can i pass the data from redux form, So that i can access that data in App.js? here is the code i have written using redux-form.after i click on submit the data should be passed from form.js to app.js. and the data should be displayed on page. here is form.js- const Form=({fields:{name,address}})=>( <form> <center> <div> <label>First Name</label> <Field type="text" component="input" placeholder="Name" name="name"/> </div> <div> <label>Address</label> <Field type="text" component="input" placeholder="Phone" name="phone" /> </div> <button type="submit">Submit</button> </center> </form> )

DatePicker in Redux Form

半腔热情 提交于 2019-11-27 18:23:13
问题 i'd like to use DatePicker for selecting date using redux form. I create this: import React from 'react'; import DatePicker from 'react-datepicker'; import 'react-datepicker/dist/react-datepicker.css'; export default field => ( <div> <DatePicker onChange={field.value} selected={field.value} isClearable={true} > {field.children} </DatePicker> {field.meta.touched && field.meta.error && <span className="error">{field.meta.error}</span>} </div> ); <div className="form-group"> <div className="col

Redux-form handleSubmit: How to access store state?

早过忘川 提交于 2019-11-27 12:50:02
问题 In a redux-form handleSubmit function, which makes an Ajax call, some properties from the Redux state are needed in the Ajax (e.g. user ID). This would be easy enough if I wanted to define handleSubmit in the form's component: Just call mapStateToProps to pass in whatever I need, and read it from this.props in my handleSubmit . However, like a good React-Redux developer I write separate view components and containers , so my view components can be simple with little or no behavior. Therefore,

How to embed the same redux-form multiple times on a page?

人盡茶涼 提交于 2019-11-27 04:23:22
问题 I'm having an issue trying to embed multiple forms on one page. I noticed configForm executes once, even with multiple forms on the page, that's why I can't dynamically generate different form names. Screenshot showing multiple text fields bound together. function configForm(){ const uuid = UUID.generate(); const config = { form:`AddCardForm_${uuid}`, fields:['text'], validate:validate } return config; } export default reduxForm(configForm(), mapStateToProps, {togglePanelEditMode,

How to get Redux Form data in another Component

北城余情 提交于 2019-11-26 23:28:46
问题 How can i pass the data from redux form, So that i can access that data in App.js? here is the code i have written using redux-form.after i click on submit the data should be passed from form.js to app.js. and the data should be displayed on page. here is form.js- const Form=({fields:{name,address}})=>( <form> <center> <div> <label>First Name</label> <Field type="text" component="input" placeholder="Name" name="name"/> </div> <div> <label>Address</label> <Field type="text" component="input"

How to richly style AOR Edit page

半腔热情 提交于 2019-11-26 18:39:49
问题 Have to create an edit Page editing a number of parameters on an instance of a'tale' resource. However adding any element such as an MUI Card or even a div, is causing the app to freeze in various ways. These are the approaches I have tried. 1) Adding a card component or placing my elements within a div for styling export const EditorEditTale = (props) => { return ( <Edit {...props} title="Tale Editor"> <SimpleForm > <div> <Image /> <TaleCardHeader props={ props } style={taleCardHeaderStyle

Programmatically change Redux-Form Field value

白昼怎懂夜的黑 提交于 2019-11-26 14:12:08
问题 When I use redux-form v7, I find there is no way to set the field value. Now in my form , I have two select component. The second's value will be clear when the first select component value changed. In class render: <div className={classNames(style.line, style.largeLine)}> <div className={style.lable}>site:</div> <div className={style.content}> <Field name="site" options={sites} clearable={false} component={this.renderSelectField} validate={[required]} /> </div> </div> <div className=

Handling async request with React, Redux and Axios?

♀尐吖头ヾ 提交于 2019-11-26 06:46:56
问题 I am new to React JS and Redux and it has been too overwhelming to get going. I am trying to make a POST request using Axios, but I am unable to make it. May be I am missing something in the container file. Below is the code. Check plnkr Update: I am getting @@redux-form/SET_SUBMIT_SUCCEEDED message after submitting. But when I am checking in the network tab, I don\'t see the call to API. And also when I am consoling the submitted values, I see only name and fullname values. It doesn\'t