diff --git a/landing/button.react.js b/landing/button.react.js --- a/landing/button.react.js +++ b/landing/button.react.js @@ -2,10 +2,12 @@ import * as React from 'react'; +import type { OnClick } from 'lib/types/core'; + import css from './button.css'; type Props = { - +onClick: (event: SyntheticEvent) => mixed, + +onClick: OnClick, +children?: React.Node, }; diff --git a/lib/types/core.js b/lib/types/core.js --- a/lib/types/core.js +++ b/lib/types/core.js @@ -1,3 +1,5 @@ // @flow export type Shape = $ReadOnly<$Rest>; + +export type OnClick = (event: SyntheticEvent) => mixed; diff --git a/web/components/button.react.js b/web/components/button.react.js --- a/web/components/button.react.js +++ b/web/components/button.react.js @@ -3,10 +3,12 @@ import classnames from 'classnames'; import * as React from 'react'; +import type { OnClick } from 'lib/types/core'; + import css from './button.css'; type Props = { - +onClick: (event: SyntheticEvent) => void, + +onClick: OnClick, +children: React.Node, +variant?: 'primary' | 'secondary' | 'danger' | 'round', +type?: string,