prismicio / slice-simulator

Preview and develop Prismic slices fast with minimal configuration
6 stars 5 forks source link

fix(react): correct `sliceZone` prop type for `<SliceSimulator>` #8

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

Description

This PR fixes the type for <SliceSimulator>'s sliceZone prop. It replaces the props' function's return type from React.ComponentType to JSX.Element.

See this comment for the details on the error users will current see: https://github.com/prismicio/slice-machine/issues/430#issuecomment-1083103192

Background info: React.ComponentType is the type for a component, such as a function component (() => JSX.Element) or class component. JSX.Element is a low-level type that represents the return type of a component that returns JSX.

Checklist:

🦆

codecov-commenter commented 2 years ago

Codecov Report

Merging #8 (65e7e2e) into master (87425aa) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master       #8   +/-   ##
=======================================
  Coverage   64.75%   64.75%           
=======================================
  Files          27       27           
  Lines         610      610           
  Branches      110      110           
=======================================
  Hits          395      395           
  Misses        215      215           
Impacted Files Coverage Δ
packages/react/src/SliceSimulator.tsx 12.12% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87425aa...65e7e2e. Read the comment docs.

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
./packages/com/dist/index.js 3.75 KB (0%)
./packages/com/dist/index.cjs 3.76 KB (0%)
./packages/core/dist/index.js 5.83 KB (0%)
./packages/core/dist/index.cjs 6.56 KB (0%)
./packages/react/dist/index.js 8.99 KB (0%)
./packages/react/dist/index.cjs 9.9 KB (0%)
./packages/vue/dist/index.js 6.27 KB (0%)
./packages/vue/dist/index.cjs 7.04 KB (0%)
./packages/vue3/dist/index.js 14.63 KB (0%)
./packages/vue3/dist/index.cjs 158.77 KB (0%)
lihbr commented 2 years ago

LGTM

lihbr commented 2 years ago

Released in @prismicio/slice-simulator-react@0.2.1