-
Is good to have a method to get all Number of array which used to create parseAsNumberLiteral. |
Beta Was this translation helpful? Give feedback.
Answered by
franky47
Mar 8, 2024
Replies: 1 comment
-
You could export the options if you need them at runtime somewhere else, that's how I do it: // searchParams.ts
export const diceValues = [1, 2, 3, 4, 5, 6] as const
export const diceParser = parseAsNumberLiteral(diceValues)
// component.tsx
import { diceValues } from './searchParams'
for (const faceValue of diceValues) {
...
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kavan72
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could export the options if you need them at runtime somewhere else, that's how I do it: