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
I've got the component integrated and working correct but how are the returned values used to render a react icon component on the frontend? The values returned for FA for example are not title cased and contain hyphens so can't directly associate to font-awesome icons (i'm using react-icons/fa).
I've got the component integrated and working correct but how are the returned values used to render a react icon component on the frontend? The values returned for FA for example are not title cased and contain hyphens so can't directly associate to font-awesome icons (i'm using react-icons/fa).
When using the option outputFormat: 'react' the returned values should not contain hyphens, they should be title cased. So based on your code snippets everything looks fine. Are you using the latest version of the plugin? The outputFormat option was not introduced until v2.0.0.
Just inspected the datasource after using your Sanity Schema and it looks title cased, just like it should:
hey sorry for the delay -- thank you -- I think the issue is with my nextjs implementation still can't get properly cased returns from iconPicker from my current project but with a vanilla nextjs / sanity app I can.
I've got the component integrated and working correct but how are the returned values used to render a react icon component on the frontend? The values returned for FA for example are not title cased and contain hyphens so can't directly associate to font-awesome icons (i'm using react-icons/fa).
Sanity Schema
Usage
And usage in a react component
<DynamicFaIcon name={blurb.icon.name} />
The text was updated successfully, but these errors were encountered: