You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code generates two <button>'s and an <input> field whose type changes respective to the type of button clicked (or dependent on the component state).
So, if my rendered field is type number and it has the value 42 and I tap the <button> to change the field type to text with new value hello world!, react tries to set <input type='number' />'s value to 'hello world!' before changing field type to text, which generates a warning in the console as show below:
The value definitely set's once the type changes, which is after the value, however the warning is generated.
The text was updated successfully, but these errors were encountered:
gurinderhans
changed the title
React re-render changed value field first before re-rendering the node
React re-render changes <input> value field first before type and re-rendering the node
Apr 30, 2016
The following code generates two
<button>
's and an<input>
field whose type changes respective to the type of button clicked (or dependent on the componentstate
).So, if my rendered field is type
number
and it has the value42
and I tap the<button>
to change the field type totext
with new valuehello world!
, react tries to set<input type='number' />
's value to'hello world!'
before changing field type totext
, which generates a warning in the console as show below:The value definitely set's once the
type
changes, which is after thevalue
, however the warning is generated.The code is below:
The text was updated successfully, but these errors were encountered: