get data from url using react
this.props.match.params.id
get data from url using react
this.props.match.params.id
get data from url react
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter, Route } from "react-router-dom";
const AppRouter = () => (
<BrowserRouter>
<Route path='/:parameter1/:parameter2/:parameter3' render={(props) => <App {...props} />} />
</BrowserRouter>
);
const App = (props) => {
const { parameter1, parameter2, parameter3 } = props.match.params;
return (
<div>
First: {parameter1} <br />
Second: {parameter2} <br />
Third: {parameter3} <br />
</div>
);
};
ReactDOM.render(<AppRouter />, document.getElementById("root"));
get data from url using react
<Route path="/users/:id" component={UserPage}/>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us