react-timeseries-charts icon indicating copy to clipboard operation
react-timeseries-charts copied to clipboard

Warning: Failed prop type: Invalid prop `info` supplied to `EventMarker`.

Open BrendanJones44 opened this issue 9 years ago • 2 comments

Hey, I was wondering if anybody could help with this issue I'm having. I have a Linechart with this EventMarker code, and on the page everything is functioning okay, but I get this warning the first time my chart component is mounted. Warning: Failed prop type: Invalid prop info supplied to EventMarker.

Any idea why? I did various null checks to make sure it wasn't passing info something that was null (like state not being initialized), but that still led to the warning.

       return (
                <EventMarker
                    axis="axis"
                    event={this.state.trackerEvent}
                    column="value"
                    info={[
                        { label: "Reason For Change", value: this.state.trackerStoryReason},
                        { label: "Sprint Name", value: this.state.trackerStoryName},
                        { label: "Change", value: this.state.trackerValue},
                    ]}
                    infoTimeFormat="%b %e, %I:%M %p"
                    infoWidth={225}
                    infoHeight={80}
                    markerRadius={3}
                    markerStyle={{ fill : "red" }}
                />
            );

BrendanJones44 avatar Jul 26 '17 16:07 BrendanJones44

Is one of the things you're passing in as value (this.state.trackerValue for example) not a string? Both label and value need to be strings and that's enforced in the prop types.

pjm17971 avatar Jul 26 '17 16:07 pjm17971

Yup! That was it! Thank you!

BrendanJones44 avatar Jul 26 '17 18:07 BrendanJones44