victoraalvarez
victoraalvarez
SSolidJS
Created by victoraalvarez on 7/4/2023 in #support
Question on Functions vs Components
Hey all! I have a quick question. What is the difference between using plain functions versus using components when both return JSX? I realized just now I accidentally had used functions instead of components in my code but when I changed them to components, it broke the functionality. Is it okay to use either or?
10 replies
SSolidJS
Created by victoraalvarez on 7/3/2023 in #support
Uncaught ReferenceError: createDeepSignal is not defined
Not really sure what I'm doing wrong here. I definitely have SolidJS >v1.5 and I'm using a close copy of the documentation example. Do I need to manually create createDeepSignal? I feel like I'm making a silly error somewhere in here haha. Any help would be greatly appreciated! My code is below:
import { createResource, createSignal } from "solid-js";
import { createStore } from "solid-js/store";

const fetchData = async (path: string): Promise<any> => {
return await(
await fetch(path)
).json();
}

const [resource] = createResource(fetchData, {
storage: createDeepSignal
});

export const getData = () => [resource];
import { createResource, createSignal } from "solid-js";
import { createStore } from "solid-js/store";

const fetchData = async (path: string): Promise<any> => {
return await(
await fetch(path)
).json();
}

const [resource] = createResource(fetchData, {
storage: createDeepSignal
});

export const getData = () => [resource];
5 replies