Skip to content

Commit

Permalink
React19: Update "Removed deprecated TypeScript types"
Browse files Browse the repository at this point in the history
`npx types-react-codemod@latest preset-19 ./`

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-deprecated-typescript-types

And then fix the useRef type to add `undefined`
  • Loading branch information
tordans committed May 24, 2024
1 parent 2e3ca0c commit a699cf0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/_components/forms/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { zodResolver } from '@hookform/resolvers/zod'
import { PropsWithoutRef, ReactNode, useState } from 'react'
import { PropsWithoutRef, ReactNode, useState, type JSX } from 'react'
import { FormProvider, UseFormProps, useForm } from 'react-hook-form'
import { IntlProvider } from 'react-intl'
import { twMerge } from 'tailwind-merge'
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/forms/LabeledCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorMessage } from '@hookform/error-message'
import { ComponentPropsWithoutRef, PropsWithoutRef, forwardRef } from 'react'
import { ComponentPropsWithoutRef, PropsWithoutRef, forwardRef, type JSX } from 'react'
import { useFormContext } from 'react-hook-form'
import { twJoin, twMerge } from 'tailwind-merge'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/forms/LabeledRadiobutton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ErrorMessage } from '@hookform/error-message'
import { ComponentPropsWithoutRef, PropsWithoutRef, forwardRef } from 'react'
import { ComponentPropsWithoutRef, PropsWithoutRef, forwardRef, type JSX } from 'react'
import { useFormContext } from 'react-hook-form'
import { twJoin, twMerge } from 'tailwind-merge'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/forms/LabeledSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorMessage } from '@hookform/error-message'
import { twJoin } from 'tailwind-merge'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef } from 'react'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef, type JSX } from 'react'
import { useFormContext } from 'react-hook-form'

export interface LabeledSelectProps extends PropsWithoutRef<JSX.IntrinsicElements['select']> {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/forms/LabeledTextField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorMessage } from '@hookform/error-message'
import { twJoin } from 'tailwind-merge'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef } from 'react'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef, type JSX } from 'react'
import { useFormContext } from 'react-hook-form'

export interface LabeledTextFieldProps extends PropsWithoutRef<JSX.IntrinsicElements['input']> {
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/forms/LabeledTextareaField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ErrorMessage } from '@hookform/error-message'
import { twJoin } from 'tailwind-merge'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef } from 'react'
import { ComponentPropsWithoutRef, forwardRef, PropsWithoutRef, type JSX } from 'react'
import { useFormContext } from 'react-hook-form'

export interface LabeledTextareaProps extends PropsWithoutRef<JSX.IntrinsicElements['textarea']> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CalculatorOutput } from './CalculatorOutput'
import { flattenSubcategories } from './utils/flattenSubcategories'

export const Calculator = () => {
const drawControlRef = useRef<MapboxDraw>()
const drawControlRef = useRef<MapboxDraw | undefined>(undefined)

// This blob ist just to check if the Calculator should be enabled
// by checking the sourceData.
Expand Down

0 comments on commit a699cf0

Please sign in to comment.