You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with canvas related libraries, in order to use Cerb colors you have to hack around the document body. We should provide a hook that makes this easier for the user.
Create a new hook called useChartColors with the use client directive at the top of
the file
Create an useReducer<{ tokenName: string }> to hold the value
Add a useEffect to put your document canvas code in which will update the state
return a useMemo of the state - unless you are doing useReducer, then you don't need that
Use the hook to get the values for the chart customization in the client component
Duplicates
Latest version
Summary 💡
When working with canvas related libraries, in order to use Cerb colors you have to hack around the document body. We should provide a hook that makes this easier for the user.
Create a new hook called useChartColors with the use client directive at the top of
Examples 🌈
Goal to have an API like this
Motivation 🔦
No response
The text was updated successfully, but these errors were encountered: