question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

input value can't be edit

See original GitHub issue
import React,{Component} from 'react';
import { Field, reduxForm } from 'redux-form';

const renderInput = field =>{
	return (
    	<input {...field.input} type={field.type}/> 
	)
} 
const ContactPage =(props)=>(
	<div>
		<Field  
		name="otherMoney" 
		component={renderInput} 
		type="text"
		/>
	</div>
)

export default reduxForm({
	form: 'recharge-form'
})(ContactPage);

My Component successfully renders and I can see all the actions being dispatched inside the Redux Dev tools window, but when I try to enter text into the fields it won’t do any thing, however the actions are dispatched like I said.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

21reactions
xavierfuentescommented, Feb 13, 2017

I can see now that the problem is that I’m trying to use redux-form and I should use redux-form/immutable instead. From here

21reactions
eligoldingcommented, Jan 4, 2017

Make sure you are mounting your reducer in the right place. It must be under form in your redux state.

const store = createStore(combineReducers({ form: reducer }))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I change my input value in React even with the ...
I made one component, passed props to it from a store, on componentWillMount I make a new state for component. Rendering is fine...
Read more >
HTML input readonly Attribute - W3Schools
A read-only input field cannot be modified (however, a user can tab to it, highlight it, and copy the text from it). The...
Read more >
Editing inputs - IBM
Edit and configure the inputs in your service.
Read more >
Unable to type in Input field issue in React [Solved] | bobbyhadz
To solve the issue of being unable to type in an input field in React, make sure to use the `defaultValue` prop instead...
Read more >
Make React Input TextField Editable with value state and ...
https://codedocu.com/Software/React/Components/Make-React- Input -Editable?27531. Use defaultValue instead of value2. React TextField or Form ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found