Skip to content

Select initialValue not getting updated on re-render #907

Answered by rvsia
salujaharkirat asked this question in Need help
Discussion options

You must be logged in to vote

Hey @jinxac , I think you can make a simple workaround to reinitialize initialValue each time options are changed:

  1. everytime options are changed, change key on the select (i.e. increase number by one)

This should ensure that the select will be re-mounted.

  1. sets initializeOnMount = true

This ensures that the initialValue will be updated when the component is mounted.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rvsia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #907 on December 11, 2020 11:35.