React let the route jump automatically after judging that the return value of the interface is correct.

in actions, a method is defined to call the interface, and then the method defined in actions is called in the page. When the actions method successfully requests the interface, how to automatically jump to the specified path,

wrote this.props.history.push ("") in actions, then reported to history undefined, and then tried a lot of writing methods, but failed to achieve results. Please help me and give some ideas. Thank you very much

.
Apr.08,2022
The

method call uses the method name. Bind (this, parameter) , change the this > point to


first introduce import {Link, withRouter} from "react-router-dom";
then wrap const Component = withRouter (createForm () (_ Component));
so that history will not report undefined

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b366c7-4059d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b366c7-4059d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?