Skip to content

Commit

Permalink
Use local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopkovacs committed Jan 11, 2024
1 parent 97ffa90 commit 4a7842c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions app/routes/form.tsx
Original file line number Diff line number Diff line change
@@ -149,11 +149,11 @@ export const useReactFormDocsConfig = () => {
selected: framework!,
available: availableFrameworks,
onSelect: (option: { label: string; value: string }) => {
const url =
generatePath(match.id, {
...match.params,
framework: option.value,
}) + `?framework=${option.value}`
const url = generatePath(match.id, {
...match.params,
framework: option.value,
})
localStorage.setItem('framework', option.value)

navigate(url, { state: { framework } })
},
@@ -201,8 +201,7 @@ export const useReactFormDocsConfig = () => {
return {
label: d.label,
children: [
...d.children.map(({ to, ...d }) => ({
to: `${to}?framework=${framework}`,
...d.children.map((d) => ({
...d,
badge: 'core',
})),

0 comments on commit 4a7842c

Please sign in to comment.