Skip to content

Commit

Permalink
fix: looser SliceZoneComponents type to support non-const slice_type
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Oct 9, 2021
1 parent b0300d3 commit c227fec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/SliceZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ export type SliceZoneComponents<
[SliceType in keyof Record<
TSlice["slice_type"],
never
>]: SliceComponentType<Extract<TSlice, SliceLike<SliceType>>, TContext>;
>]: SliceComponentType<
Extract<TSlice, SliceLike<SliceType>> extends never
? SliceLike
: Extract<TSlice, SliceLike<SliceType>>,
TContext
>;
};

/**
Expand Down

0 comments on commit c227fec

Please sign in to comment.