SolidJSS
SolidJSโ€ข2y agoโ€ข
13 replies
tomahl

Destructuring with splitProps

Hi there,

Are there any disadvantages of destructuring the local object compared to the second example?

const [{ cat, dog, elk }, rest] = splitProps(props, ['cat', 'dog', 'elk']);

<div>${cat}</div>
vs
const [local, rest] = splitProps(props, ['cat', 'dog', 'elk']);

<div>${local.cat}</div>
Was this page helpful?