From 9ce2b30a68c354d14a84e100c2b6889e75fde5de Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Mon, 23 Mar 2020 11:40:19 -0700 Subject: [PATCH] Add `className` and `css` to `BaseProps` `className` is a default DOM-level prop in React, and it feels wrong to omit this since it's possible in vanilla JS to pass this. `css` is exposed via styled-components, but only works with the Babel plugin, which rewrites any element with a `css` prop and converts it into a proper styled-component component. See https://styled-components.com/docs/api#css-prop for more information. --- index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 44689f8d24a..5b934528fd2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,6 +6,8 @@ declare module '@primer/components' { export interface BaseProps extends React.Props { as?: React.ReactType + className?: string + css?: string title?: string // NOTE(@mxstbr): Necessary workaround to make work to?: History.LocationDescriptor @@ -145,7 +147,11 @@ declare module '@primer/components' { export const StyledOcticon: React.FunctionComponent - export interface DropdownProps extends React.Props, StyledSystem.ColorProps, StyledSystem.SpaceProps, ButtonProps { + export interface DropdownProps + extends React.Props, + StyledSystem.ColorProps, + StyledSystem.SpaceProps, + ButtonProps { as?: React.ReactType title?: string | React.ReactNode }