tomahl
tomahl
SSolidJS
Created by tomahl on 5/9/2024 in #support
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>
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>
const [local, rest] = splitProps(props, ['cat', 'dog', 'elk']);

<div>${local.cat}</div>
14 replies