R
R
Rapen2020-05-26 13:50:54
JavaScript
Rapen, 2020-05-26 13:50:54

Why is an array with data passed to the component through an object?

Actually there is a functional component? What does this mean, why does an array with data advanced into this component need to be placed in an object? Is this a new replacement for props? If you directly write arrList, then it simply will not be found in the function
export const Notes = ({arrList}) => {

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Robur, 2020-05-26
@Rapen

so done api of functional components. The object in which the props are passed to the function. This is the device of the universe at this local point, humble yourself and do as described in the documentation.
If curly brackets confuse you, you can write

export const Notes = (props) => { // дальше props.arrList

E
Egor Babintsev, 2020-05-26
@egor_babintsev

Google about object destructuring in js and understand the principle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question