Reputation: 537
How I can use React-Router to point directly to a route defined with Express on the backend instead of rendering a component? I want to return valid JSON with no HTML included in the response.
Upvotes: 0
Views: 67
Reputation: 464
React-Router only handles routing on the React frontend.
There is no way for React-Router to point to an Express Route on the back end.
A React component would have to use that API endpoint.
Why not just hit the endpoint manually.
Upvotes: 1