Skip to content

Fix LivePreview types#349

Closed
kyletsang wants to merge 1 commit intoFormidableLabs:masterfrom
kyletsang:live-preview-types
Closed

Fix LivePreview types#349
kyletsang wants to merge 1 commit intoFormidableLabs:masterfrom
kyletsang:live-preview-types

Conversation

@kyletsang
Copy link

LivePreview forwards all props to the rendered Component, but the current types doesn't allow you to do so because they aren't explicitly defined in the Props type. In my code, it was showing an error when I was trying to pass className into LivePreview.

This PR changes the types so that the rest of the props can be inferred from what type of component is used.

I also removed fallbackComponent because you can do the same thing by using a default param of "div"

@vercel
Copy link

vercel bot commented Apr 7, 2023

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

Name Status Preview Comments Updated (UTC)
react-live ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2023 6:53am

@genepaul
Copy link

Can this be approved/merged? I'm also encountering this issue and would like to not have to override the react-live types.

@carloskelly13
Copy link
Contributor

Thank you for the contribution. I moved it over to this project's new directory structure and added a changeset. #356

@carloskelly13
Copy link
Contributor

carloskelly13 commented May 11, 2023

Released as part of 4.1.0, once again thanks!

https://github.com/FormidableLabs/react-live/releases/tag/react-live%404.1.0

@kyletsang kyletsang deleted the live-preview-types branch May 14, 2023 01:15
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.

3 participants