Skip to content

Commit

Permalink
Replace JSX.IntrinsicElements with React.JSX.IntrinsicElements
Browse files Browse the repository at this point in the history
Fixes jaredpalmer#4011.

This is for compatibility with React v19, where the global JSX namespace went away.
  • Loading branch information
Philipp91 committed Dec 7, 2024
1 parent 0e0cf9e commit b405a5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/formik/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ export interface SharedRenderProps<T> {
}

export type GenericFieldHTMLAttributes =
| JSX.IntrinsicElements['input']
| JSX.IntrinsicElements['select']
| JSX.IntrinsicElements['textarea'];
| React.JSX.IntrinsicElements['input']
| React.JSX.IntrinsicElements['select']
| React.JSX.IntrinsicElements['textarea'];

/** Field metadata */
export interface FieldMetaProps<Value> {
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import cn from 'classnames';
import { HTMLProps } from 'react';

export const Container: React.FC<JSX.IntrinsicElements['div']> = ({
export const Container: React.FC<React.JSX.IntrinsicElements['div']> = ({
className,
...props
}) => {
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/FormiumLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

export const FormiumLogo: React.FC<JSX.IntrinsicElements['svg']> = props => {
export const FormiumLogo: React.FC<React.JSX.IntrinsicElements['svg']> = props => {
return (
<svg
width={'101px'}
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/forwardRefWithAs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function forwardRefWithAs<Props, ComponentType extends As>(
Test components to make sure our dynamic As prop components work as intended
type PopupProps = {
lol: string;
children?: React.ReactNode | ((value?: number) => JSX.Element);
children?: React.ReactNode | ((value?: number) => React.JSX.Element);
};
export const Popup = forwardRefWithAs<PopupProps, 'input'>(
({ as: Comp = 'input', lol, className, children, ...props }, ref) => {
Expand Down

0 comments on commit b405a5d

Please sign in to comment.