question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error occurs when using Timeline.Item

See original GitHub issue

Version

2.10.0

Environment

React 15.5.4, antd 2.10.0, Typescript 2.3.4

Reproduction link

https://files.gitter.im/ant-design/ant-design/h5se/image.png

Steps to reproduce

import { Timeline } from 'antd'

<Timeline>
    <Timeline.Item>Create a services site 2015-09-01</Timeline.Item>
    <Timeline.Item>Solve initial network problems 2015-09-01</Timeline.Item>
    <Timeline.Item>Technical testing 2015-09-01</Timeline.Item>
    <Timeline.Item>Network problems being solved 2015-09-01</Timeline.Item>
</Timeline>

What is expected?

No error.

What is actually happening?

error TS2604: JSX element type ‘Timeline.Item’ does not have any construct or call signatures.


Maybe I use it in a wrong way, but when I change static Item: React.ReactNode; to static Item: any; in node_modules/antd/lib/timeline/Timeline.d.ts error fixed, everything is fine.

Looking forward to your reply.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zyqxdcommented, Jun 7, 2017

It’s a mistype issue, here’s a workaround without editing the modules folder (which is a bad idea):

import { Timeline } from "antd";
const TimelineItem = Timeline.Item as any

<Timeline>
    <TimelineItem>Create a services site 2015-09-01</TimelineItem>
    <TimelineItem>Solve initial network problems 2015-09-01</TimelineItem>
    <TimelineItem>Technical testing 2015-09-01</TimelineItem>
    <TimelineItem>Network problems being solved 2015-09-01</TimelineItem>
</Timeline>
0reactions
lock[bot]commented, Jun 8, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve Excel Timeline Filter Errors caused by SQL ...
In this blog post you will learn step by step how to resolve Excel Timeline Filter Errors caused by SQL Server OLAP Data...
Read more >
Using lambda expression in constructor of Timeline object ...
Timeline timeline = new Timeline(new KeyFrame(Duration. millis(5000), (ActionEvent event) -> { //do something })); The reason NetBeans is ...
Read more >
DAM Asset Timeline Error - Experience League Community
Solved: When I go to the DAM to look at the revision history of any asset, I'm getting an error. The page spins...
Read more >
[Timeline] NullReferenceException error ... - Unity Issue Tracker
Steps to repro: 1. Open MultipleClips scene from the attached project. 2. Windows > Timeline. 3. Select Cube game object. 4. Select "Recorded" ......
Read more >
Content Timeline Normal Text problem - WordPress.org
1. Please try switching to another theme, like Twenty Seventeen, and check whether the issue persists. If yes, then it is not the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found