esbenp / react-native-clean-form

Easy react-native forms using bootstrap-like syntax with redux-form+immutablejs integration. Styled using styled-components
http://esbenp.github.io/2017/01/06/react-native-redux-form-immutable-styled-components/
MIT License
478 stars 83 forks source link

Text is dessapearing when I try to type #48

Open Gerald17 opened 7 years ago

Gerald17 commented 7 years ago

Text automatically is deleted (i.e. reverts back to the placeholder) when I type something. I'm working on android, any ideas?

crjackso commented 7 years ago

I'm having this same issue. @Gerald17, did you find a solution?

Gerald17 commented 7 years ago

Hi @crjackso

Not really for this. Its a weird issue but I replace this form with this https://github.com/halilb/react-native-textinput-effects/blob/master/README.md it has some cool effects for inputs and you can use state to handle data

markusguenther commented 7 years ago

Sorry work and my little kids take a lot of time actually ... but try to look on the issues.

Gerald17 commented 7 years ago

Don't worry, still is really good form. I'll try to fix it too

sejsworld commented 6 years ago

I have the same issue, text disappers all the time, as well as selections from select

clay-morgan commented 6 years ago

Maybe from not wiring up the form reducer when using redux-form. I do this sometimes.

infostreams commented 6 years ago

I can confirm that this behaviour is caused by not wiring up redux-form correctly, and basically not using the provided reducer in your redux store.

An example of how to wire up redux-form correctly is in the example, specifically here. You can install the non-immutable reducer as follows:

import { reducer as form } from 'redux-form'

const reducer = combineReducers({ form })
const store = createStore(reducer, {})

If you use redux-form for your Form, it will use the information it finds in Redux to populate the form fields. If you didn't install the reducer, then the state in Redux will stay perpetually empty, and this empty state will be transmitted to your form fields, which will manifest itself by disappearing the text as you type it. Mystery solved 😉 Hope this helps someone.

infostreams commented 6 years ago

I actually think this issue can be closed...

The-Code-Monkey commented 6 years ago

yeah the reason text was disappearing is because you didnt have the reducer form setup so redux had nowhere to put the data