Skip to content

Commit

Permalink
Add support for React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Dec 17, 2024
1 parent 2eb49e0 commit aae800c
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 777 deletions.
2 changes: 1 addition & 1 deletion iconoir.com/components/IconList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function IconList({ filters, allIcons }: IconListProps) {
: null;

let children = null;
const listRef = React.useRef<List<IconRow[]> | null>();
const listRef = React.useRef<List<IconRow[]> | null>(null);
const [height, setHeight] = React.useState(400);

const iconWidth = iconsPerRow
Expand Down
5 changes: 2 additions & 3 deletions iconoir.com/components/ReactWindowScroller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ interface ChildOpts<Props extends ListProps | GridProps> {
onScroll: Props['onScroll'];
}
interface ReactWindowScrollerProps<Props extends ListProps | GridProps> {

children: (opts: ChildOpts<Props>) => React.ReactElement;
throttleTime?: number;
isGrid?: boolean;
Expand All @@ -58,8 +57,8 @@ export function ReactWindowScroller<
throttleTime = 10,
isGrid = false,
}: ReactWindowScrollerProps<Props>) {
const ref = useRef<any>();
const outerRef = useRef<HTMLElement>();
const ref = useRef<any>(null);
const outerRef = useRef<HTMLElement>(null);
const targetElement = typeof window === 'undefined' ? (undefined as any) : window;

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions iconoir.com/components/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface SliderProps extends ReactSliderProps<number[]> {
}

export function Slider(props: SliderProps) {
const trackRef = React.useRef(null);
const trackRef = React.useRef<HTMLDivElement>(null);
const numberFormatter = useNumberFormatter(props.formatOptions);
const state = useSliderState({ ...props, numberFormatter });

Expand Down Expand Up @@ -99,7 +99,7 @@ export function Slider(props: SliderProps) {

interface ThumbProps {
state: SliderState;
trackRef: React.RefObject<HTMLElement>;
trackRef: React.RefObject<HTMLElement | null>;
index: number;
}

Expand Down
30 changes: 15 additions & 15 deletions iconoir.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
"devDependencies": {
"@nodesecure/npm-registry-sdk": "3.0.0",
"@octokit/rest": "21.0.2",
"@react-aria/focus": "^3.15.0",
"@react-aria/i18n": "^3.9.0",
"@react-aria/slider": "^3.7.3",
"@react-aria/utils": "^3.22.0",
"@react-aria/visually-hidden": "^3.8.7",
"@react-stately/slider": "^3.4.5",
"@react-types/slider": "^3.7.0",
"@react-aria/focus": "^3.19.0",
"@react-aria/i18n": "^3.12.4",
"@react-aria/slider": "^3.7.14",
"@react-aria/utils": "^3.26.0",
"@react-aria/visually-hidden": "^3.8.18",
"@react-stately/slider": "^3.6.0",
"@react-types/slider": "^3.7.7",
"@types/animejs": "^3.1.12",
"@types/lodash": "^4.14.202",
"@types/lodash": "^4.17.13",
"@types/node": "22.10.2",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/react-window": "^1.8.8",
"animejs": "^3.2.2",
"csvtojson": "^2.0.10",
"eslint-config-next": "15.1.0",
"iconoir-react": "workspace:*",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"moment": "^2.30.1",
"next": "^15.1.0",
"next-mdx-remote": "^5.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-window": "^1.8.10",
"remark-gfm": "4.0.0",
"remark-prism": "^1.3.6",
"scule": "^1.1.1",
"styled-components": "^6.1.1",
"scule": "^1.3.0",
"styled-components": "^6.1.13",
"typescript": "5.7.2",
"use-resize-observer": "^9.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/iconoir-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
"react": "^16.8.6 || ^17 || ^18"
},
"devDependencies": {
"@types/react": "^18.2.45"
"@types/react": "^19.0.1"
}
}
Loading

0 comments on commit aae800c

Please sign in to comment.