santosfrancisco/react-awesome-styled-grid

Usage examples don't work as shown

Closed this issue · 3 comments

The usage exmpales under https://awesome-styled-grid.netlify.com/usage which use a style property on Row or Col don't work as shown.

It fails with the error TS2322:
(JSX attribute) style: {} Type '{ children: Element; style: {}; }' is not assignable to type 'IntrinsicAttributes & IGridRowProps & { children?: ReactNode; }'. Property 'style' does not exist on type 'IntrinsicAttributes & IGridRowProps & { children?: ReactNode; }'.ts(2322)

My setup:
typescript v3.8.3
react v16.12.0
styled-components v5.0.1

I can set styles to the FCs if I Style them with styled-components:

const StyledRow = styled(Row)`
    height: 80px;
`;

This could be fixed by adding
style?: React.CSSProperties;
to the IGridRowProps in index.d.ts

I added pull request #95 to resolve this bug.

Waiting for this to be merged! @santosfrancisco

Sorry for the delay. Thanks for the contribution @DJmRek . Your PR has been merged.