Skip to content

Commit

Permalink
fix(typescript): Allow axis to be AxisProps or null
Browse files Browse the repository at this point in the history
Setting an axis to `null` is the only way to disable it, so we have to specify it as an authorised value in the TypeScript definitions.
  • Loading branch information
olivierphi authored and Raphaël Benitte committed Jan 14, 2019
1 parent 6ebef54 commit 5d45796
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/line/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ declare module '@nivo/line' {

theme?: Theme

axisTop?: AxisProps
axisRight?: AxisProps
axisBottom?: AxisProps
axisLeft?: AxisProps
axisTop?: AxisProps | null
axisRight?: AxisProps | null
axisBottom?: AxisProps | null
axisLeft?: AxisProps | null

enableGridX?: boolean
enableGridY?: boolean
Expand Down
8 changes: 4 additions & 4 deletions packages/scatterplot/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ declare module '@nivo/scatterplot' {

margin?: Box

axisTop?: AxisProps
axisRight?: AxisProps
axisBottom?: AxisProps
axisLeft?: AxisProps
axisTop?: AxisProps | null
axisRight?: AxisProps | null
axisBottom?: AxisProps | null
axisLeft?: AxisProps | null

enableGridX?: boolean
enableGridY?: boolean
Expand Down

0 comments on commit 5d45796

Please sign in to comment.