Kasper
Component is not updated when prop is changed
My very basic understanding would say that passing a Accessor would cause less updates as only the parts of the subcomponent that is affected is updated. But i am not sure at all. And i really want to learn the best practices 🙂
34 replies
Component is not updated when prop is changed
@._rb sorry for the late reply, what if i have a component without a resources. Such like the one below that is used multiple in places. Some place where the props are static and other where they are dynamic. such as:
At the dynamic location i create the componet like this:
<CategorySelector leftExpand={true} type={type()} value={categoryId} onChange={setCategoryId} />
but when type()
updates the component is not updated. Is the right approach here to send in type as the Accessor
and not just as the value. and then when it is static i need to wrap my static field in a createSignal("my-type")[0]
?34 replies
Component is not updated when prop is changed
From what i have been able to understand for my googleing is that SolidJS dose not rerender a component when the props change. So am i correct in assuming that i should give the documentId as an
Accessor<string | undefined>
instead? That works but is it the correct way of doing it?34 replies