Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic timeline is not rendered properly #376

Open
Grz3hu opened this issue Jun 1, 2023 · 0 comments
Open

Dynamic timeline is not rendered properly #376

Grz3hu opened this issue Jun 1, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Grz3hu
Copy link

Grz3hu commented Jun 1, 2023

import { Chrono } from "react-chrono";
import axios from "axios";
import React, { useEffect, useState } from "react";
import { useParams } from "react-router-dom";

export default function Timeline() {
    const [timeline, setTimeline] = useState({});

    const { id } = useParams();

    useEffect(() => {
        loadTimeline();
    }, []);

    const loadTimeline = async () => {
        const result = await axios.get(`http://localhost:8080/timeline/${id}`);
        setTimeline(result.data);
    };

    return (
        <div>
            <h2 className="text-center m-4">{timeline.title}</h2>
            <Chrono items={timeline.events} mode={timeline.mode} allowDynamicUpdate={true} />
        </div>
    );

How it looks:
image

Somehow when site is reloaded by vscode the timeline is rendered correctly
image

@prabhuignoto prabhuignoto self-assigned this Jun 3, 2023
@prabhuignoto prabhuignoto added the bug Something isn't working label Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants