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

borderColor prop missing from BarProps type def #344

Closed
SandyGifford opened this issue Nov 14, 2018 · 1 comment
Closed

borderColor prop missing from BarProps type def #344

SandyGifford opened this issue Nov 14, 2018 · 1 comment

Comments

@SandyGifford
Copy link

SandyGifford commented Nov 14, 2018

Summary

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:

image

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>'.
@plouc
Copy link
Owner

plouc commented Nov 18, 2018

@SandyGifford, can you please use this issue instead? It's easier to track down missing/wrong type defs.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants