Fix website errors related to props/children

This commit is contained in:
Fred Carlsen
2019-02-25 15:22:35 +01:00
parent d48af7c4c2
commit c6cdea77b6
9 changed files with 67 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import styled from 'styled-components';
import { withFilteredProps } from 'ts/utils/filter_props';
interface Props {
alt?: string;
@@ -12,6 +13,6 @@ const ImageClass: React.FunctionComponent<Props> = (props: Props) => {
return <img {...props} />;
};
export const Image = styled(ImageClass)<Props>`
export const Image = styled(withFilteredProps(ImageClass, ['alt', 'src']))<Props>`
margin: ${props => props.isCentered && `0 auto`};
`;