Skip to content

Commit

Permalink
chore: react v19
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Dec 10, 2024
1 parent 0a985a0 commit 803f76b
Show file tree
Hide file tree
Showing 14 changed files with 1,426 additions and 597 deletions.
10 changes: 5 additions & 5 deletions apps/dotlottie-next-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@lottiefiles/dotlottie-react": "workspace:*",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18"
"next": "15.0.4",
"react": "^19",
"react-dom": "^19"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "^19",
"@types/react-dom": "^19",
"typescript": "^5"
}
}
3 changes: 2 additions & 1 deletion apps/dotlottie-next-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"incremental": true,
"paths": {
"@/*": ["./src/*"]
}
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down
8 changes: 4 additions & 4 deletions apps/dotlottie-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"canvaskit-wasm": "^0.39.1",
"lottie-web": "^5.12.2",
"postcss": "8.4.32",
"react": "^18.2.0",
"react": "^19.0.0",
"react-device-detect": "^2.2.3",
"react-dom": "^18.2.0",
"react-dom": "^19.0.0",
"react-dropzone": "^14.2.3",
"react-icons": "^5.0.1",
"react-range": "^1.8.14",
Expand All @@ -32,8 +32,8 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
Expand Down
1 change: 1 addition & 0 deletions apps/dotlottie-viewer/src/components/form/base-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const BaseSelect: React.FC<BaseSelectProps> = ({ className = '', items, placehol
if (items.length === 0) {
return (
<span className={`min-h-9 text-gray-500 text-xs flex items-center gap-2 h-10`}>
{/* @ts-ignore */}
<FaInfoCircle />
{emptyMessage}
</span>
Expand Down
5 changes: 5 additions & 0 deletions apps/dotlottie-viewer/src/components/players.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export default function Players() {
}
}}
>
{/* @ts-ignore */}
<GiPreviousButton />
</button>
) : null}
Expand All @@ -188,6 +189,7 @@ export default function Players() {
lottieWebRef.current?.play();
}}
>
{/* @ts-ignore */}
<FaPlay />
</button>
) : (
Expand All @@ -197,6 +199,7 @@ export default function Players() {
lottieWebRef.current?.pause();
}}
>
{/* @ts-ignore */}
<FaPause />
</button>
)}
Expand All @@ -209,6 +212,7 @@ export default function Players() {
}
}}
>
{/* @ts-ignore */}
<GiNextButton />
</button>
) : null}
Expand Down Expand Up @@ -278,6 +282,7 @@ export default function Players() {
<span className="w-max pl-1 bg-transparent">{totalFrames}</span>
</span>
<button className="cursor-pointer" onClick={() => dispatch(setLoop(!loop))}>
{/* @ts-ignore */}
<ImLoop className={`${!loop ? 'text-gray-500' : ''}`} />
</button>
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/dotlottie-viewer/src/components/top-bar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { JSX } from 'react';
import { useRef } from 'react';
import { useAppDispatch, useAppSelector } from '../store/hooks';
import { resetUserConfig, setSrc, setUserSrc } from '../store/viewer-slice';
Expand Down Expand Up @@ -49,6 +50,7 @@ const TopBar: React.FC<TopBarProps> = ({ className = '', ...props }) => {
<>
<span className="font-bold">Try it yourself!</span>

{/* @ts-ignore */}
<Dropzone onDrop={onDrop} onDropRejected={onDropRejected}>
{(state): JSX.Element => {
return (
Expand Down
2 changes: 2 additions & 0 deletions apps/dotlottie-viewer/src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DotLottie } from '@lottiefiles/dotlottie-react';
import type { JSX } from 'react';
import { useAppDispatch, useAppSelector } from '../store/hooks';
import { setSrc, setUserSrc } from '../store/viewer-slice';
import { useEffect, useRef } from 'react';
Expand Down Expand Up @@ -53,6 +54,7 @@ export const Home = (): JSX.Element => {

return (
<>
{/* @ts-ignore */}
<Dropzone noClick onDrop={onDrop} onDropRejected={onDropRejected}>
{(state): JSX.Element => {
return (
Expand Down
2 changes: 2 additions & 0 deletions apps/dotlottie-viewer/src/pages/perf.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
import type { JSX } from 'react';
import { ChevronUpDownIcon } from '@heroicons/react/20/solid';
import { DotLottieWorkerReact, DotLottieReact, setWasmUrl as setDotLottieWasmUrl } from '@lottiefiles/dotlottie-react';
import { Player as LottieWeb } from '@lottiefiles/react-lottie-player';
Expand Down Expand Up @@ -289,6 +290,7 @@ export const Perf = (): JSX.Element => {
<li key={`${anim.name}-${anim.lottieURL}-${index}`} className={`${anim.name}-${index}`}>
{player.id === 0 && <DotLottieReact src={anim.lottieURL} style={size} loop autoplay />}
{player.id === 1 && <DotLottieWorkerReact src={anim.lottieURL} style={size} loop autoplay />}
{/* @ts-ignore */}
{player.id === 2 && <LottieWeb src={anim.lottieURL} style={size} loop autoplay />}
{player.id === 3 && <SkottiePlayer lottieURL={anim.lottieURL} width={size.width} height={size.height} />}
<h3 className="mt-6 text-lg font-semibold text-white">{anim.name}</h3>
Expand Down
8 changes: 4 additions & 4 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"type-check": "tsc --noEmit"
},
"peerDependencies": {
"react": "^17 || ^18"
"react": "^17 || ^18 || ^19"
},
"dependencies": {
"@lottiefiles/dotlottie-web": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.37",
"@types/react": "^19.0.1",
"cross-env": "7.0.3",
"react": "^18.2.0",
"tsup": "8.0.1",
"react": "^19.0.0",
"tsup": "8.3.5",
"typescript": "5.0.4"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/dotlottie-worker.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import type { DotLottieWorker, Config } from '@lottiefiles/dotlottie-web';
import { useEffect, type ComponentProps, type RefCallback } from 'react';
import { useEffect, type ComponentProps, type RefCallback, type JSX } from 'react';

import { useDotLottieWorker } from './use-dotlottie-worker';
import useStableCallback from './use-stable-callback';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/dotlottie.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import type { DotLottie, Config } from '@lottiefiles/dotlottie-web';
import { useEffect, type ComponentProps, type RefCallback } from 'react';
import { useEffect, type ComponentProps, type RefCallback, type JSX } from 'react';

import { useDotLottie } from './use-dotlottie';
import useStableCallback from './use-stable-callback';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/use-dotlottie-worker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from '@lottiefiles/dotlottie-web';
import { DotLottieWorker } from '@lottiefiles/dotlottie-web';
import { useCallback, useState, useEffect, useRef } from 'react';
import { useCallback, useState, useEffect, useRef, type JSX } from 'react';
import type { ComponentProps, RefCallback } from 'react';

interface DotLottieWorkerComponentProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/use-dotlottie.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from '@lottiefiles/dotlottie-web';
import { DotLottie } from '@lottiefiles/dotlottie-web';
import { useCallback, useState, useEffect, useRef } from 'react';
import { useCallback, useState, useEffect, useRef, type JSX } from 'react';
import type { ComponentProps, RefCallback } from 'react';

interface DotLottieComponentProps {
Expand Down
Loading

0 comments on commit 803f76b

Please sign in to comment.