S
SolidJS2y ago
Max

Is it safe to spread props

Just wanna double check if its okay to spread props from a reactivity standpoint. I understand the possible issues with destructuring, I'm wondering if the same applies for spreading props onto child component ie
type Props = {
readonly whatever:Record<string, number>
}

const Comp = (props:Props) => {

return <AnotherComp {...props}/>
}
type Props = {
readonly whatever:Record<string, number>
}

const Comp = (props:Props) => {

return <AnotherComp {...props}/>
}
2 Replies
fabiospampinato
any form of reading something that could read signals has the same drawbacks If you spread inside the JSX though that's handled specially, so that code should be fine
Max
MaxOP2y ago
okay cool thanks
Want results from more Discord servers?
Add your server