How to wrap up Ant Design with Styled Components and TypeScript?

前端 未结 5 1534
独厮守ぢ
独厮守ぢ 2021-02-13 15:47

I want to wrap up my ant-design components with styled-components, I know that this is possible (https://gist.github.com/samuelcastro/0ff7db4fd54ce2b80cd1c34a85b40c08) however I

5条回答
  •  生来不讨喜
    2021-02-13 16:18

    my code is here. and it is work.

    
    import React from 'react';
    import { Button as AntButton } from 'antd';
    import { ButtonProps } from 'antd/lib/button/button';
    import styled from 'styled-components';
    
    const Container = styled.div`
      font-size: 20px;
    `;
    
    
    const Button: React.FunctionComponent = styled(AntButton)`
      margin-top: 24px;
      margin-left: 30px;
    `;
    
    export default function Home() {
      return (
        
          Hello World
          
        
      );
    }
    
    
    
    

提交回复
热议问题