0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00
This commit is contained in:
Florian Schroedl 2024-06-12 16:48:13 +02:00
parent a79d1013bf
commit 908cc2240f

View file

@ -86,7 +86,12 @@
(defonce !tokens-cache (atom nil))
(defn use-resolved-tokens [tokens]
(defn use-resolved-tokens
"The StyleDictionary process function is async, so we can't use resolved values directly.
This hook will return the unresolved tokens as state until they are processed,
then the state will be updated with the resolved tokens."
[tokens]
(let [tokens-state (mf/use-state (get @!tokens-cache tokens tokens))]
(mf/use-effect
(mf/deps tokens)