how to solve this error?( TypeError: Cannot read property 'name' of undefined) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to solve this error?( TypeError: Cannot read property 'name' of undefined)

import React from "react"; import {Box,Typography} from '@material-ui/core'; const Information =({data})=> { return ( <Box> <Typography>Location {data.name}</Typography> </Box> ) } export default Information;

8th Jun 2021, 4:42 PM
Shweta
Shweta - avatar
2 Answers
+ 1
Shweta Before you can understand and solve this problem, do you understand what is {data} means in function component below: const Information = ({data}) => { } ? How do you call this function component in jsx, eg. <Information .... />?
9th Jun 2021, 10:05 AM
Calviղ
Calviղ - avatar
10th Jun 2021, 2:37 PM
Calviղ
Calviղ - avatar