Understanding how props is updated

With earlier JavaScript, arrow function callbacks that had a method after the equality sign were used.

var str = "Visit Tirana.";
var res = str.replace("Tirana", "the Rocky Mountains");

In React, setting props is done with the name of the component being the new product. props seems like it should be the variable name. It is hard to understand.
const MyComponent = (props) => {something };
React

const ChildComponent = () => {  

  return <p>Child 1</p>;

This is an idea. Set child as product in const = ChildComponent.
Scan those that are passed “props.” (props)
Attach unique value earlier passed to parent to props. .propName

<Parent>
<ChildComponent propname="propname's value" />
</Parent>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.