Open 5P5 opened 2 hours ago
related issues
but those PRs did not fix
The reason why the last works is because it's in the same node as getTime which is reactive.
The issue here is likely that we are not creating an underlying signal on to string.
{date}
not working is a known limitation. All output would need to be bloated with more explicit conversions to account for this. You are supposed to use date.toString()
if you want this output.
{date.valueOf()}
seems to currently not be captured by the implementation that only checks for methods beginning with get
, to
and set
.
valueOf
could be added as special case here.
{date}
not working is a known limitation. All output would need to be bloated with more explicit conversions to account for this.
Oh yeah i was about to write...the problem is actually that date
is not reactive per se (the properties are) so when generating the code it doesn't wrap it in an effect.
Also what the tutorial is saying is that you need to reassign date = new Date();
to make it work without SvelteDate
Like this repl
Describe the bug
svelte reactivity is completely broken out of the box.
with
import { SvelteDate } from 'svelte/reactivity'
please see playground example.h1
is reactive, as reasonably expectedh2
andh3
are both not reactive! (time not updating)h4
that is suddenly reactive?!なに??!! is the behavior indented? am I missing something?
bonus change playground example
nothing updates at all.
according to Advanced Svelte / Advanced reactivity / Reactive built-ins that should work.
Reproduction
svelte.dev/playground
Logs
No response
System Info
Severity
blocking all usage of svelte