react-materialize / react-materialize

Material design for react, powered by materializecss
https://react-materialize.github.io/
MIT License
1.38k stars 305 forks source link

Radio Button does not re-render when given a value #882

Open masonjwhite opened 5 years ago

masonjwhite commented 5 years ago

Description

Hey folks. We are using a radio button in a custom survey application. The value for said radio button is being provided via a redux store.

As we update the redux store (once a user clicks a radio button), and the user moves onto the next question (with a new default value coming in from state), the radio button is not re-rendering to account for the new value.

Upon inspection of the element using the Chrome Developer tools I can indeed confirm that the "value" attribute on the element is mismatched with what the radio button is rendering.

Steps to Reproduce

  1. Create a radio button component with the value tied to a piece of state
  2. Change the value in state (via onChange handler or whatever works)

Expected behavior: [What you expect to happen] Radio button should re-render to match the updated value coming in from state.

Actual behavior: [What actually happens] The radio button's value prop is updated but the component does not re-render.

Screen Shot 2019-06-13 at 10 30 40 AM Screen Shot 2019-06-13 at 10 30 50 AM

Versions

react-materialize: 3.1.1 materialize-css: 1.0.0 react: 16.8.2

masonjwhite commented 5 years ago

Is there any update on this?