FF
FF
SSolidJS
Created by FF on 9/10/2024 in #support
How to update date object?
I have the following situation: I have an array of date object and I need to update the date by knowing its index.
var [days, setDays] = createSignal(
[new Date(768523467), new Date(9837465836256)],
);
var [days, setDays] = createSignal(
[new Date(768523467), new Date(9837465836256)],
);
So I tried this approach and it doesn't work.
setDays((d) => {
d[0].setTime(Date.now());

return d;
});
setDays((d) => {
d[0].setTime(Date.now());

return d;
});
------------------------------------------------------
return (
<div>
<For each={days}>
{(day) => {
return <div>{`${day}`}</div>;
}}
</For>
</div>
);
return (
<div>
<For each={days}>
{(day) => {
return <div>{`${day}`}</div>;
}}
</For>
</div>
);
So how can I do that via "mutation" approach? (I don't need immutable way) Whould I use createMutable or createStore for that?
8 replies
SSolidJS
Created by FF on 1/4/2024 in #support
Lowercase props
What is point of lowercase props "tabIndex" vs "tabindex", "onClick" vs "onclick" and etc?
37 replies
SSolidJS
Created by FF on 11/24/2023 in #support
Behavior of "Portal" component
Is it possible to use the "Portal" component, so that it won't create additional wrapper (div) around?
13 replies