Closed lihbr closed 7 months ago
Path | Size |
---|---|
./dist/index.cjs | 8.03 KB (+0.1% 🔺) |
./dist/index.js | 6.05 KB (+0.13% 🔺) |
./dist/react-server.cjs | 7.22 KB (+0.14% 🔺) |
./dist/react-server.js | 5.58 KB (+0.2% 🔺) |
Thanks, good catch! This version is simple to read.
Types of changes
Description
Mapped slices would cause the
<TODOSliceComponent />
component to throw because of a different interface used by mapped slices (slice type being top level instead of nested under theslice
property).This standardizes the props given to
<TODOSliceComponent />
so everything keeps working smoothly based on our Svelte implementation: https://github.com/prismicio/prismic-svelte/blob/master/src/SliceZone/SliceZone.svelte#L118-L128I first explored adapting the
<TODOSliceComponent />
to support different interfaces instead, but it resulted in messier code in my opinion: https://github.com/prismicio/prismic-vue/blob/95d5771b51dc45df5bd6663178afceae8942dc4c/src/components/SliceZone.ts#L263-L280 (hence the sister PR for Vue: https://github.com/prismicio/prismic-vue/pull/70)Checklist: