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: use correct return type for View.Port #1883

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

9inpachi
Copy link
Contributor

Why

The return type of View.Port was ReactNode which is not correct as it's supposed to be used as a JSX element. The documented usage of the component/function was giving the following error:

image

The main reason why ReactNode cannot be used like this is because ReactNode type can possibly be undefined which is not valid JSX (null is the valid alternate). See more on stackoverflow: https://stackoverflow.com/questions/72392225/reactnode-is-not-a-valid-jsx-element

What

The return type of View.Port is changed to JSX.Element so it can be used as JSX. The TypeScript error is gone now.

image

Checklist

  • (Not Applicable) Documentation updated (example)
  • (Not Applicable) Storybook entry added (example)
  • Ready to be merged

Copy link

vercel bot commented Mar 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 18, 2024 10:41pm

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@drcmda drcmda merged commit fd91d6f into pmndrs:master Apr 2, 2024
4 checks passed
Copy link

github-actions bot commented Apr 2, 2024

🎉 This PR is included in version 9.103.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants