how to solve this error?( TypeError: Cannot read property 'name' of undefined) | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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 Respostas
+ 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