Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: Resolve 'Icon is Not a Function' Error in PresetItems #5260

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

danny-avila
Copy link
Owner

Summary

I fixed the TypeError: Icon is not a function error in PresetItems by properly using functional components and improving TypeScript typings.

  • Fixed the incorrect usage of the Icon component in PresetItems.tsx by ensuring it is used as a React component instead of a function call.
  • Improved the typing of presets and icons to better reflect possible undefined values and correct component types.
  • Modified the getIconKey function to return the correct type for better type safety.
  • Updated other components and utility functions to handle optional properties and prevent potential runtime errors.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 24beda3 into main Jan 11, 2025
2 checks passed
@danny-avila danny-avila deleted the fix/preset-type-error branch January 11, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant