For further actions, you may consider blocking this person and/or reporting abuse
Read next
Learn how to create an animated input field with Tailwind CSS
Michael Andreuzza -
Supercharge Your Node.js Apps: Zero-Copy I/O Secrets for Blazing Performance
Aarav Joshi -
Aliases in React with Vite: And how they Simplify Your Imports 🚀.
Lawani Elyon John -
Slowloris Attack: How it Works, Identify and Prevent
Certera -
Top comments (2)
Use BrowserRouter which uses HTML5 history API (pushState, replaceState and the popstate event) to keep your UI in sync with the URL.
After successful API request you can do
this.props.history.push("/path-to-redirect");
. Make sure to wrap your component with --> withRouter.
I'm assuming you're not using router dom, on parent component or the component you want to redirect use state like {renderPost:false} initially,then use method to toggle the state which renders post component , in post component pass a function as prop which makes {renderPost :false} in parent component, so whenever you want to redirect you can use method from props like this.props.Redirect()