From 518c424ca4a023f3faebce0adf64219989be0018 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Tue, 6 Mar 2018 15:51:06 +0800 Subject: [PATCH] Improve Grid and Layout type definition --- components/grid/col.tsx | 4 +--- components/grid/row.tsx | 4 +--- components/layout/Sider.tsx | 4 +--- components/layout/layout.tsx | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/components/grid/col.tsx b/components/grid/col.tsx index 3cb60341d7..3faf9bfcf0 100644 --- a/components/grid/col.tsx +++ b/components/grid/col.tsx @@ -13,8 +13,7 @@ export interface ColSize { pull?: number; } -export interface ColProps { - className?: string; +export interface ColProps extends React.HTMLAttributes { span?: number; order?: number; offset?: number; @@ -27,7 +26,6 @@ export interface ColProps { xl?: number | ColSize; xxl?: number | ColSize; prefixCls?: string; - style?: React.CSSProperties; } export default class Col extends React.Component { diff --git a/components/grid/row.tsx b/components/grid/row.tsx index a58c3fa698..1cd599c11e 100644 --- a/components/grid/row.tsx +++ b/components/grid/row.tsx @@ -31,13 +31,11 @@ export type BreakpointMap = { xxl?: string }; -export interface RowProps { - className?: string; +export interface RowProps extends React.HTMLAttributes { gutter?: number | BreakpointMap; type?: 'flex'; align?: 'top' | 'middle' | 'bottom'; justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between'; - style?: React.CSSProperties; prefixCls?: string; } diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index d7765a8f31..e8cbf777fa 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -31,10 +31,8 @@ const dimensionMap = { export type CollapseType = 'clickTrigger' | 'responsive'; -export interface SiderProps { - style?: React.CSSProperties; +export interface SiderProps extends React.HTMLAttributes { prefixCls?: string; - className?: string; collapsible?: boolean; collapsed?: boolean; defaultCollapsed?: boolean; diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx index c7fb224c19..39f7e73d50 100644 --- a/components/layout/layout.tsx +++ b/components/layout/layout.tsx @@ -3,10 +3,8 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { SiderProps } from './Sider'; -export interface BasicProps { - style?: React.CSSProperties; +export interface BasicProps extends React.HTMLAttributes { prefixCls?: string; - className?: string; hasSider?: boolean; }