Skip to content

Commit

Permalink
refactor: slice slice_id > id
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Aug 2, 2022
1 parent 9b90fab commit be245ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/SliceZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type ExtractSliceType<Slice extends SliceLike> = Slice extends SliceLikeRestV2
*/
export type SliceLikeRestV2<SliceType extends string = string> = {
slice_type: prismicT.Slice<SliceType>["slice_type"];
slice_id?: string;
id?: string;
};

/**
Expand Down Expand Up @@ -306,8 +306,8 @@ export const SliceZone = <TContext,>({
}

const key =
"slice_id" in slice && slice.slice_id
? slice.slice_id
"id" in slice && slice.id
? slice.id
: `${index}-${JSON.stringify(slice)}`;

return (
Expand Down

0 comments on commit be245ce

Please sign in to comment.