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

[recharts] Add explicit types for children #56257

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions types/recharts/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export interface BarData {
}

export interface BarProps extends EventAttributes, Partial<PresentationAttributes>, Animatable {
children?: React.ReactNode;
dataKey: DataKey; // As the source code states, dataKey will replace valueKey in 1.1.0 and it'll be required (it's already required in current implementation).
className?: string;
fill?: string;
Expand Down Expand Up @@ -465,6 +466,7 @@ export type LineChartProps = CategoricalChartWrapper & EventAttributes;
export class LineChart extends React.Component<LineChartProps> { }

export interface PieProps extends EventAttributes, Partial<PresentationAttributes>, Animatable {
children?: React.ReactNode;
className?: string;
dataKey: DataKey; // As the source code states, dataKey will replace valueKey in 1.1.0 and it'll be required (it's already required in current implementation).
cx?: number | string;
Expand Down Expand Up @@ -856,6 +858,7 @@ export interface SectorProps extends EventAttributes, Partial<PresentationAttrib
export class Sector extends React.Component<SectorProps> { }

export interface TextProps extends Partial<PresentationAttributes> {
children?: React.ReactNode;
className?: string;
scaleToFit?: boolean;
angle?: number;
Expand Down Expand Up @@ -986,6 +989,7 @@ export interface XPadding {
// NOTE: the lib's implementation doesn't inherits the event props (it's kept in this definition due to the previous typing definition has it).
export interface XAxisProps extends EventAttributes {
allowDecimals?: boolean;
children?: React.ReactNode;
hide?: boolean;
// The name of data displayed in the axis
name?: string | number;
Expand Down Expand Up @@ -1046,6 +1050,7 @@ export interface YPadding {
// NOTE: the lib's implementation doesn't inherits the event props (it's kept in this definition due to the previous typing definition has it).
export interface YAxisProps extends EventAttributes {
allowDecimals?: boolean;
children?: React.ReactNode;
hide?: boolean;
// The name of data displayed in the axis
name?: string | number;
Expand Down