Closed sergioisidoro closed 5 months ago
Adding key to a component will return type error. eg
key
error TS2322: Type '{ children: Element[]; key: number; }' is not assignable to type 'Omit<PixiOptionsType<ContainerOptions<ContainerChild>>, "children"> & { children?: ReactNode; } & { ...; } & EventHandlers & DrawCallback'. Property 'key' does not exist on type 'Omit<PixiOptionsType<ContainerOptions<ContainerChild>>, "children"> & { children?: ReactNode; } & { ...; } & EventHandlers & DrawCallback'. 159 <pixiContainer key={i}> ~~~
No type error
{someArray.map.... <pixiContainer key={i}> <Rectangle x={year.worldStart} y={0} width={year.worldEnd - year.worldStart} height={baseHeight} lineColor='0xCCCCCC' /> </pixiContainer> }
@pixi/react
pixi.js
React
ReactDOM
Fixed in 8.0.0-dev.9db4138.
8.0.0-dev.9db4138
Current Behavior
Adding
key
to a component will return type error. egExpected Behavior
No type error
Steps to Reproduce
Environment
@pixi/react
version: 8.0.0-dev.4657710pixi.js
version: ^8.2.1React
version: e.g. ^18.2.0ReactDOM
version: e.g. ^18.2.0