Comments (8)
@SaiRev0 Sorry, I didn't find it, only a workaround.
I tried installing an earlier version (2.4.0) and it seems to not have this problem. But unfortunately this version has the problem of inconsistent random ids generated by client and server.
Recent releases seem to use more browser APIs, so I ended up wrapping it into a client-only component.
// react-chrono-client.ts
"use client"
import type { Chrono as ChronoType } from "react-chrono";
import dynamic from 'next/dynamic'
export const Chrono = dynamic(() => import('react-chrono').then(lib => lib.Chrono), {
ssr: false,
}) as typeof ChronoType
from react-chrono.
@swastkk have you tried running the app with the use client directive
Yes, I tried that and it doesn't work. The reason is that nextjs pre-renders client components on server as well. So even if it's marked as use client
, chrono
will still be rendered on server. Maybe putting window
access into useEffect
would work?
from react-chrono.
@swastkk are you running this from a Next JS app or is it a React SPA.
from react-chrono.
@swastkk are you running this from a Next JS app or is it a React SPA.
I am working on NextJS
from react-chrono.
@swastkk have you tried running the app with the use client directive
from react-chrono.
@KarsonJo Hey, so did you find any solution ??
from react-chrono.
@KarsonJo what u did here can u help me to understand ? i want to render chrono component at client side..
from react-chrono.
@KarsonJo what u did here can u help me to understand ? i want to render chrono component at client side..
@Milan-Bhingradiya dynamic
with ssr: false
defines a component that wraps Chrono
and turns off server-side rendering. After that, you need to import Chrono
from this file (called react-chrono-client.ts
in this example) instead. Then you can use it as usual without rendering on server.
from react-chrono.
Related Issues (20)
- Can't align timelineContent HOT 3
- Slide Navigation Button doesn't work. HOT 2
- TypeScript checking for props of <Chrono> doesn't work due to path aliases in typing files HOT 1
- When use the control panel to change the selected item from timeline HOT 2
- Prop to hide navigation HOT 1
- donβt need the entire card, just need a cardtitle
- Still Prompt
- Make the items array usable
- Drag and Drop HOT 1
- Base Line Style update on basis of events HOT 1
- Application Error: Converting circular structure to JSON when using timelineContent HOT 2
- Horizontal timeline overflow
- 'parseDetailsAsHTML' Does Not Appear to be Working HOT 3
- Add search on jump to toolbar HOT 2
- Add an option to hide the new Toolbar HOT 3
- hideControls not working HOT 5
- Additional control over timelinePoint
- textDensity prop is not reactive HOT 2
- Warning: Each child in a list should have a unique "key" prop. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-chrono.