-
Notifications
You must be signed in to change notification settings - Fork 4
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
Slice type: Slice Simulator x Slice Zone(s) type mismatch #34
Comments
Related: prismicio/prismic-react#144 We might be able to solve this specific issue by changing Slice Simulator’s types, but the issue seems to root in SliceZone’s types. It expects both the An ideal solution would support untyped props (i.e. using a generic This results in a looser, but more ergonomic, system. Typing Slice components should still work as long as it satisfies |
So... Are we removing the I'm fine with this "looser, more ergonomic" solution as you put it |
I spent a decent amount of time on this last week and didn't get to a place that I was happy with. Disconnecting I plan to revisit this soon with a fresh start. Maybe an obvious solution will pop up. 🙂 |
OK, let me know if I can help! While using the same types, Vue components aren't able to infer types the same way or use generics so they aren't facing this issue so far 🤔 |
This is fixed as of prismicio/prismic-react#154. The fix has not been published yet as I would like to bundle it with a few other fixes, but I think it's safe to close this issue. If we discover that the PR did not fix the issue, we can reopen. |
When typing slices with TypeScript, SliceZone(s) infers their types from the
components
map prop. This causes a type mismatch from slices provided by Slice Simulator as that cannot be typed(?).See:
What is expected?
Slice array provided by Slice Simulator should match expected SliceZone
slices
prop type when slice components are typed.What is actually happening?
Slice array provided by Slice Simulator doesn't match expected SliceZone
slices
prop type when slice components are typed.Potential fixes?
I'm posting this issue here as I'm not sure which kit it really belongs to. I can see few fixes but I don't really like them:
any
;The text was updated successfully, but these errors were encountered: