From 69d2476af3a2da056a94ee3efd98a8a9c13467cd Mon Sep 17 00:00:00 2001 From: Ken Kunz Date: Wed, 16 Sep 2026 09:45:04 -0500 Subject: [PATCH] Allow string `size` and `strokeWidth` in the icon context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot's PR comment correctly surfaced a gap in the PR - the same type bug exists in the lucide-react-native project and wasn't fixed there. Same narrowing as the other framework contexts: `LucideProps` accepts `size?: string | number`, and `strokeWidth` resolves to react-native-svg's `NumberProp` (`string | number`), but the context and `LucideProviderProps` declared both as `number`. `Icon.ts` passes the context value straight through — `width: width ?? size ?? contextSize` — so nothing downstream needs a number. --- packages/lucide-react-native/src/context.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/lucide-react-native/src/context.ts b/packages/lucide-react-native/src/context.ts index 3dd87faa8..2c78235aa 100644 --- a/packages/lucide-react-native/src/context.ts +++ b/packages/lucide-react-native/src/context.ts @@ -1,9 +1,9 @@ import { createContext, createElement, type ReactNode, useContext, useMemo } from 'react'; const LucideContext = createContext<{ - size?: number; + size?: number | string; color?: string; - strokeWidth?: number; + strokeWidth?: number | string; /** * @deprecated Use `nonScalingStroke` instead. */ @@ -19,9 +19,9 @@ const LucideContext = createContext<{ interface LucideProviderProps { children: ReactNode; - size?: number; + size?: number | string; color?: string; - strokeWidth?: number; + strokeWidth?: number | string; /** * @deprecated Use `nonScalingStroke` instead. */