Can we pass props to a component that has the same name and value implicitly?
Example:
Let\'s say that I have a variable called x: const x = 1
I had a slight epiphany when reading these answers. Since in ES6+ you can add an existing variable to an object like this:
const x = 42;
const obj = { x, y: 1337 };
console.log(obj); // result { x: 42, y: 1337 }
That means you can add a named prop to a React component like:
const x = 42;
const elm = ;