You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TypeScript type def for BarProps is missing the borderColor property. Adding borderColor to a Bar or ResponsiveBar raises a typing error, although the compiled JS does correctly add the border color to the graph.
Example
The following code (error in comments):
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Bar } from "@nivo/bar";
const target = document.createElement("div");
document.body.appendChild(target);
ReactDOM.render(
<Bar
keys={["cow", "chicken"]}
data={[{ id: "A", cow: 5, chicken: 3 }, { id: "B", cow: 1, chicken: 8 },]}
indexBy="id"
width={500}
height={500}
borderWidth={3}
borderColor="black" />, // Type Error: "Property 'borderColor' does not exist on type ..."
target
);
will correctly create the following graph:
The full error is:
[ts] Property 'borderColor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Bar> & Readonly<{ children?: ReactNode; }> & Readonly<Data & ColorProps<BarDatum> & Partial<{ indexBy: string | IndexByFunc; keys: string[]; ... 29 more ...; markers: CartesianMarkerProps[]; }> & Partial<...> & SvgDefsAndFill<...> & Partial<...> & Dimensions>'.
The text was updated successfully, but these errors were encountered:
Summary
The TypeScript type def for
BarProps
is missing theborderColor
property. AddingborderColor
to aBar
orResponsiveBar
raises a typing error, although the compiled JS does correctly add the border color to the graph.Example
The following code (error in comments):
will correctly create the following graph:
The full error is:
The text was updated successfully, but these errors were encountered: