catalog
catalog copied to clipboard
state can only be strings?
```react|plain,light,span-3
state: {
date: new Date(),
}
---
<div>{state.date}</div>
^^ shows up as "new Date()", like it's turned into a string instead of generating a date.
Saving new Date() to an external variable and passing that variable through to state turns the name of the variable to a string also.
Any ideas how to have an example using todays date in a real date format?
Have you tried using a query string at all?
state: {
date: `${new Date()}`,
}
I haven't. Does that work?