Skip to content

Instantly share code, notes, and snippets.

@pachun
Last active July 6, 2017 17:53
Show Gist options
  • Select an option

  • Save pachun/baddaf5dc583c67120808280d629fd57 to your computer and use it in GitHub Desktop.

Select an option

Save pachun/baddaf5dc583c67120808280d629fd57 to your computer and use it in GitHub Desktop.
const ForgotPasswordView = (props) => {
var showMessage = false
const handleSubmit = (form) => {
const { dispatch } = props
dispatch(resetPassword(form.email))
// this does not trigger a re-rendering because it's not state.
showMessage = true
}
console.log("showMessage: ", showMessage)
return (
<Panel>
<ForgotPasswordForm onSubmit={handleSubmit}/>
// this should show up after the onSubmit button is clicked.
{ showMessage && <span>hi there</span>}
</Panel>
)
}
export default connect()(ForgotPasswordView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment