prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
154 stars 40 forks source link

fix: use pascalCase Slice type for `<SliceZone>` resolver #109

Closed angeloashmore closed 2 years ago

angeloashmore commented 2 years ago

Types of changes

Description

<SliceZone>'s resolve prop is provided as a way to ease migration from next-slicezone. next-slicezone's component uses a resolver function to convert a Slice's type to a React component. In this process, it converts the slice_type property into a pascalcased version.

This PR fixes a compatiblity issue by adding the pascalcase conversion.

Note: The resolver prop will be removed in a future version. When the prop is removed, the changes in this PR will also be removed.

Checklist:

🐫

angeloashmore commented 2 years ago

This is published in a pre-release version: v2.0.3-debug.0.

codecov-commenter commented 2 years ago

Codecov Report

Merging #109 (dbf6e76) into master (33dea53) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
+ Coverage   92.36%   92.39%   +0.02%     
==========================================
  Files          15       15              
  Lines         262      263       +1     
  Branches       58       58              
==========================================
+ Hits          242      243       +1     
  Misses          5        5              
  Partials       15       15              
Impacted Files Coverage Δ
src/SliceZone.tsx 86.95% <100.00%> (+0.59%) :arrow_up:

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 33dea53...dbf6e76. Read the comment docs.