I have a function react element which looks like this
import { CSSProperties } from 'styled-components'
export interface StylesDictionary {
[Key: string]: CSSProperties
}
interface Props {
onClick: () => void
buttonStyle?: StylesDictionary
}
export default function PreviewButton({ onClick, buttonStyle }: Props) {
When I am trying to pass it a style like this
<PreviewButton
buttonStyle={{ marginLeft: '20px' }}
onClick={() => onClickPreview(api, tableDefinition)}
/>
Typescript is giving following error
Type 'string' has no properties in common with type 'Properties<ReactText, string & {}>'
Any idea what I could be doing wrong here?