From 773e7e286c9951924d318598ce40343322da6bea Mon Sep 17 00:00:00 2001 From: Michael Shafir Date: Tue, 31 Dec 2024 11:58:09 -0500 Subject: [PATCH 1/2] mark helper type as readonly --- libs/core/src/hooks/use-reactlit.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/core/src/hooks/use-reactlit.tsx b/libs/core/src/hooks/use-reactlit.tsx index 0db839a..3d8b2b6 100644 --- a/libs/core/src/hooks/use-reactlit.tsx +++ b/libs/core/src/hooks/use-reactlit.tsx @@ -17,16 +17,21 @@ type GenericPluginResult = Plugin extends ReactlitPlugin ? C : never; -type ApplyPlugins = Plugins extends [infer Plugin, ...infer Rest] +type ApplyPlugins = Plugins extends readonly [ + infer Plugin, + ...infer Rest +] ? GenericPluginResult & ApplyPlugins : Record; export type ReactlitFunctionWithPlugins< T extends StateBase, - P extends ReactlitPlugin[] + P extends readonly ReactlitPlugin[] > = ReactlitFunction & ReactlitContext>; -export function useReactlit

[]>(...plugins: P) { +export function useReactlit

[]>( + ...plugins: P +) { return useMemo(() => { function CustomReactlit({ children, From d000d25e97de3f1f008178bd9a8fc701d4a67437 Mon Sep 17 00:00:00 2001 From: Michael Shafir Date: Tue, 31 Dec 2024 11:58:37 -0500 Subject: [PATCH 2/2] docs(changeset): Fix to plugin helper type --- .changeset/calm-kids-bake.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/calm-kids-bake.md diff --git a/.changeset/calm-kids-bake.md b/.changeset/calm-kids-bake.md new file mode 100644 index 0000000..f491bef --- /dev/null +++ b/.changeset/calm-kids-bake.md @@ -0,0 +1,7 @@ +--- +'@reactlit/core': patch +'@reactlit/radix': patch +'@reactlit/vanilla': patch +--- + +Fix to plugin helper type