SolidJSS
SolidJSโ€ข3y agoโ€ข
15 replies
feusanc

Component doesn't rerender when prop changes

I have the component below:
export default function FolderContents(props: { path: string }) {
  const [contents] = createResource(
    async () => await fetch_directory(props.path)
  );
  
  return stuff
}


and another component that returns this, but this component doesn't rerender when the given path changes. It reacts to the change in the props, logging it out in the createEffect callback, but it doesn't rerun the createResource part. I was expecting it to rerender completely whenever the given prop changes. How would I solve this? And unfortunately I can't make the path prop a signal, it has to be a string.
Was this page helpful?