score:0
Accepted answer
You can't modify the inputValues without affecting the text fields, because both values are using the same variable, you are using the same state.
...
This would be an option if your Text were to show the default value only
const values = [
value1:'value1',
value2:'value2',
value3:'value3',
value4:'value4'
]
const [inputValues,setInputValues] = useState(values)
...
//this should be taken from your values, to be static. or from another state
<Text>{values.value1}</Text>
<Input value={inputValues.value1} onChange={onChange} name={value1}/>
Source: stackoverflow.com
Related Query
- How to show default values for text with onChange input?
- How to save my input values to text file with ReactJS?
- show default value in select input with backgroundcoulr different for each : react js
- How to pass input values from a child Form component to the state of its parent component for submission with react hooks?
- How to change the default text of the file input with reactjs?
- React useState: How can I update my useState with onChange for input and OnClick for the button?
- How can I set 2 values for one variable, and the component will render with one value, depending of some prop input
- How to show current values for select inputs with or without React Hook Form?
- How to get the label and values from multiple TextArea material ui with same onchange function for all?
- How to select all text in input with Reactjs, when it focused?
- How to specify (optional) default props with TypeScript for stateless, functional React components?
- How to properly validate input values with React.JS?
- React.js - How to set a default value for input date type
- How to use React Hooks Context with multiple values for Providers
- How to write tests for Formik-powered input components with Jest & Enzyme (useField Hook)?
- How to create a controlled input with empty default in React 15
- How to dynamically update the value for any input field with one event handler function, using hooks
- How to limit the text filed length with input type number in React JS and prevent entry of E,e, -, + etc
- How to make React input onChange set state only after onChange stops firing for set time?
- How to enable Ctrl + Z when you change an input text dynamically with React?
- How to set defaultValue, value={this.props.value}, and update the value of a text input with React?
- How to change default text in input type=“file” in reactjs?
- How do I show the HTML input date when clicking text or an image?
- How to scroll to text input on focus when there is an input accessory with React Native
- How to test an onChange input event with enzyme and jest
- How to implement onBlur/onFocus for a div with nested input fields?
- How to handle decimal values in React's onChange event for input?
- How do i annotate React.forwardRef with jsdoc comments so that intellisense can show up for the underlying component?
- ReactJS How do I use state hooks for a list of text changing buttons with a timeout?
- Using Lodash debounce with React useCallback for input onChange event
More Query from same tag
- How to bundle CSS with a component as an npm package?
- FIlter state and update React Typescript
- dynamic label width textfield outlined material ui react
- Is it okay to call another endpoint inside the then() function? ReactJS Axios
- My dapp doesn't detect when an user change their Metamask Account
- getElementByID + .appendhild() [TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.]
- Display HTML on React
- Two-way data binding on large forms
- update array of object in array of object in react
- How to filter array and create new array with specific object keys
- How to update the Redux store after Apollo GraphQL query returns
- Why does updating state from fetch result updates the whole array of objects while rendering?
- Redirect to previous path on login - React Router v4
- React Dynamic Themes
- Getting problem in making a timer/ count-down code in ReactJs
- Is it possible to add two colors to the graphic area or have two colors in the points?
- Change default color react mat ui speed dial
- How to print an object on page?
- "Cannot read property of undefined" in React after fetching and waiting
- React Checkbox Does Not Update
- restore scroll position via history push/replace state
- How to iterate over array elements inside objects in javascript
- Deciding Runtime Props Typescript
- How do array equals useState declarations work in Javascript?
- How to save the result of a mysql request in ReactJs?
- React - change route from function
- Why React-Tooltip is generated several times in array.map()?
- Unable to Solve , Hooks can only be called inside of the body of a function component
- how to switch between inputs in converter app in react?
- Material-UI LinearProgress bar not working