Redial after sending form with React-router-dom?

Asked

Viewed 392 times

0

Good afternoon guys, all right?

The situation is this, I am using the React-router-dom in an application in Reactjs and need that after clicking save in a form, the same goes to the listing screen, showing the new record. At first with the { Link } of the React-router-dom I can redirect, but I’m unable to get the CRUD list updated.

Someone would know to help me with that?

Thanks!

1 answer

1


Probably because in redirecting with the use of the router your component is not getting the state updated, then when returning to the crud listing you should add some method like shouldComponentUpdate or componentWillReceiveProps to make the list component take the current state of your application. Remember, when you make the transition between components via router your component is not initialized with the whole track (componentWillMount, componentDidMount and etc).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.