You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The readme gives the following code example: const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue']) but this raises the following typescript warning Type 'Color[]' does not satisfy the constraint 'string'.ts(2344)
This makes sense when looking at the Typescript declarations for createEnumArrayParam which is as follows: declare const createEnumArrayParam: <T extends string>(enumValues: T[])
This illustrates that only T is expected as a generic type parameter declaration while the expected function parameter is an array of T.
So I believe the solution here is update the Readme from: const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
to: const ColorArrayEnumParam = createEnumArrayParam<Color>(['red', 'green', 'blue'])
The text was updated successfully, but these errors were encountered:
The
readme
gives the following code example:const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
but this raises the following typescript warningType 'Color[]' does not satisfy the constraint 'string'.ts(2344)
This makes sense when looking at the Typescript declarations for
createEnumArrayParam
which is as follows:declare const createEnumArrayParam: <T extends string>(enumValues: T[])
This illustrates that only T is expected as a generic type parameter declaration while the expected function parameter is an array of T.
So I believe the solution here is update the
Readme
from:const ColorArrayEnumParam = createEnumArrayParam<Color[]>(['red', 'green', 'blue'])
to:
const ColorArrayEnumParam = createEnumArrayParam<Color>(['red', 'green', 'blue'])
The text was updated successfully, but these errors were encountered: