João Bezerra
João Bezerra
Explore posts from servers
TtRPC
Created by jack on 10/24/2023 in #❓-help
error route always getting 500 from trpc error? (next13/approuter)
@jack Were you able to figure out a solution?
6 replies
TtRPC
Created by jack on 10/24/2023 in #❓-help
error route always getting 500 from trpc error? (next13/approuter)
I'm running into the same problem. Regardless of the code I pass to the constructor of TRPCError when throwing I still get INTERNAL_SERVER_ERROR code on the client. Can anyone help?
6 replies
SSolidJS
Created by João Bezerra on 7/27/2024 in #support
How to wrap a store without losing reactivity
Nice! I guess this answers my question 🙂
13 replies
SSolidJS
Created by João Bezerra on 7/27/2024 in #support
How to wrap a store without losing reactivity
I was gonna say it would be cool if there was an utility for this. Also didn't know mergeProps could be used here.
13 replies
SSolidJS
Created by João Bezerra on 7/27/2024 in #support
How to wrap a store without losing reactivity
Interesting. Can you clarify what you mean by "feel like a real object"?
13 replies
SSolidJS
Created by João Bezerra on 7/27/2024 in #support
How to wrap a store without losing reactivity
Isn't there a way to do this with userWrapper being a proxy?
13 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
Of course, it would be better if the frontend received the data in the best shape for it, but sometimes that is not possible. Just because trpc's tanstack query integration seemingly does not allow for overriding the queryFn this does not mean that transforming data on the frontend is necessarily an anti-pattern.
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
I would think the problem is precisely the other way around. This is only a problem because (apparently) trpc does not allow for overriding the queryFn function. It should though as this is a very common thing to do. I'm actually surprised that it's not possible.
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
I've been able to do it by manually calling the trpc procedures inside the queryFn with the vanilla client, but I was wondering if this was possible with the tanstack query integration.
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
Also, using the select function wouldn't work as it doesn't transform the data before caching which is what I want.
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
12 replies
TtRPC
Created by João Bezerra on 7/15/2024 in #❓-help
Transform server response on the client before caching
Because I can't send the data from the server exactly the way the client wants it but I still want to transform the data before it gets put in the cache.
12 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
Okay, thanks for your help!
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
I see. Would you say then that, of the people that use eslint-plugin-solid, most just disable the warning?
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
Oh, I hadn't thought of putting the event handler outside of the component function. Is this a common idiom?
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
Could I define handleInput outside the jsx and still be able to access item without running into the linter warning?
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
Let me give a concrete example.
import { For } from "solid-js"

type PropsType = {
something: string;
}

const SomeComponent = (props: PropsType) => {
const [items, setItems] = createSignal(["One", "Two", "Three"]);

const handleInput = (item: string, value: string) => {
print(props.something, item, value);
}

return (
<div>
<For each={items()}>
{(item) => (
<input onClick={(event) => handleInput(item, event.currentTarget.value)} />
)}
</For>
</div>
);
}
import { For } from "solid-js"

type PropsType = {
something: string;
}

const SomeComponent = (props: PropsType) => {
const [items, setItems] = createSignal(["One", "Two", "Three"]);

const handleInput = (item: string, value: string) => {
print(props.something, item, value);
}

return (
<div>
<For each={items()}>
{(item) => (
<input onClick={(event) => handleInput(item, event.currentTarget.value)} />
)}
</For>
</div>
);
}
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
Right, but then I wouldn't be able to use InputEventHandler.
16 replies
SSolidJS
Created by João Bezerra on 5/8/2024 in #support
Should I disable `solid/reactivity` linter warning in this case?
What if I need to pass something else to the handler other than the event?
16 replies
SSolidJS
Created by João Bezerra on 5/2/2024 in #support
Is it ok to use a global store to persist component state between mounts?
thanks!
20 replies