-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
params in showing undefined #220
Comments
import {useParams} from "react-rouert-dom" |
I want to work on this issue. |
tell me full code to fix this |
|
const {id} = useParams(); this will work 100% ---use this before defining the function |
Thanks any question email me
…On Tue, May 2, 2023, 11:18 PM Jazib Eqbal ***@***.***> wrote:
const {id} = useParams();
this will work 100% ---use this before defining the function
—
Reply to this email directly, view it on GitHub
<#220 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2WHB4YXYR5SUWQOD5DMIV3XEFFXHANCNFSM6AAAAAAWYEDI3U>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
woking #220 |
nice |
import React from 'react' const ProductScreen = () => { ) // useParams It make working your project for sure try it once |
please help me out because params not defined .
import React from 'react'
// import {Link} from 'react-router-dom';
// import {Row , Col ,Image , ListGroup , Card , Button } from "react-bootstrap";
// import Rating from "../components/Rating";
import products from "../products";
const ProductScreen = ({ match }) => {
const product = products.find(p => p._id === match.params.id);
return (
)
}
export default ProductScreen
The text was updated successfully, but these errors were encountered: