This repository was archived by the owner on Dec 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
This repository was archived by the owner on Dec 25, 2022. It is now read-only.
Crash on render #61
Copy link
Copy link
Open
Description
Hello,
I want to use your Component in a project.
But when I want to use it, it tells me that I have reach Maximum update. It happend only when I use your Component and I check render without your library (only 2 render).
Errors :
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
Uncaught TypeError: can't access property "disconnect", _this.observer is undefined
The above error occurred in the <TickerElement> component:
TickerElement@webpack-internal:///./node_modules/.pnpm/react-ticker@1.3.2_react-dom@18.0.0+react@18.0.0/node_modules/react-ticker/dist/index.es.js:287:19
div
Ticker@webpack-internal:///./node_modules/.pnpm/react-ticker@1.3.2_react-dom@18.0.0+react@18.0.0/node_modules/react-ticker/dist/index.es.js:494:19
div
div
CurrentSongRender@webpack-internal:///./components/modules/currentSong/CurrentSongRender.tsx:15:17
div
div
div
form
CurrentSongForm@webpack-internal:///./components/modules/currentSong/CurrentSongForm.tsx:95:23
div
CurrentSongEdit@webpack-internal:///./pages/current-song/[id]/index.tsx:60:69
AuthMiddleware@webpack-internal:///./components/layout/Layout.tsx:56:20
div
div
Layout@webpack-internal:///./components/layout/Layout.tsx:70:20
I18nHOC@webpack-internal:///./node_modules/.pnpm/rosetty-react@1.0.2/node_modules/rosetty-react/dist/rosetty-react.esm.js:16:18
QueryClientProvider@webpack-internal:///./node_modules/.pnpm/react-query@3.34.19_react-dom@18.0.0+react@18.0.0/node_modules/react-query/es/react/QueryClientProvider.js:39:16
SessionProvider@webpack-internal:///./node_modules/.pnpm/next-auth@4.3.1_react-dom@18.0.0+react@18.0.0/node_modules/next-auth/react/index.js:417:18
App@webpack-internal:///./pages/_app.tsx:95:21
ErrorBoundary@webpack-internal:///./node_modules/.pnpm/next@12.1.4_0204d69bf2f8579eb9ee18cac7cd6c1a/node_modules/next/dist/compiled/@next/react-dev-overlay/client.js:8:20638
ReactDevOverlay@webpack-internal:///./node_modules/.pnpm/next@12.1.4_0204d69bf2f8579eb9ee18cac7cd6c1a/node_modules/next/dist/compiled/@next/react-dev-overlay/client.js:8:23177
Container@webpack-internal:///./node_modules/.pnpm/next@12.1.4_0204d69bf2f8579eb9ee18cac7cd6c1a/node_modules/next/dist/client/index.js:323:24
AppContainer@webpack-internal:///./node_modules/.pnpm/next@12.1.4_0204d69bf2f8579eb9ee18cac7cd6c1a/node_modules/next/dist/client/index.js:822:20
Root@webpack-internal:///./node_modules/.pnpm/next@12.1.4_0204d69bf2f8579eb9ee18cac7cd6c1a/node_modules/next/dist/client/index.js:946:21
React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
Code :
/* eslint-disable @next/next/no-img-element */
/* eslint-disable @next/next/no-page-custom-font */
import { CurrentSongTheme } from '@prisma/client';
import Ticker from 'react-ticker';
export const CurrentSongRender = ({ theme, title, artist, album, image, isPlaying }) => {
if (theme === CurrentSongTheme.default) {
return (
<div className="flex h-full w-full items-center">
<div className="h-full">
<img src={image} className="h-full rounded-md shadow-md" alt="album cover" />
</div>
<div className="h-[90%] w-full rounded-r-md bg-dark-100 pl-3 text-left">
<Ticker>
{({ index }) => (
<>
<h1 style={{ paddingRight: '0.5em' }}>This is the Headline of element</h1>
</>
)}
</Ticker>
{/* <Ticker>
{({}) => (
<>
<p className="font-bold text-white">{title}</p>
</>
)}
</Ticker> */}
</div>
</div>
);
}
return <></>;
};
Package.json :
"react": "18.0.0",
"react-dom": "18.0.0",
"react-ticker": "^1.3.2",
Thanks for your help ! ^^
Metadata
Metadata
Assignees
Labels
No labels