Is there a React shorthand for passing props?

If your variables are contained in an object, such as this.props, you spread the object:

<Elem {...this.props} />

Otherwise, you spread a new object containing the variables you need:

{...{ x, y, z }}

Although it creates a new object for no good reason.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)