Closed Dav1d-Fn closed 5 months ago
If you adjust the DOM you have to re-initialise Flip.
Alternatively you can use the JS api to generate the DOM dynamically which might be a better option in this case. https://pqina.nl/tick/#api-javascript
Thank you for your answer. I tried a few more things, but none of them worked as well as I would have liked. Perhaps I haven't yet understood exactly how it works.
I have now found a workaround that is sufficient for my use case. I haven't worked with React that often, but now I've learned that if you change the key of the component, React forces a rerender and the JS library is reinitialized. This means I can now adjust the format and the clock is updated.
If someone is interested in the full code, it is published in the project at https://github.com/Dav1d-Fn/Fliq-Desktop-Flipclock
Hello there,
I'm working on a React project and have a problem with creating new Flip Elements in the runtime. In my code I want to have a dateTimeString for custom DateTime formats. My code is generating the elements properly but new spans are not getting updated. I'm not sure if I'm using the library correct. Is this a common way how to use it?: