이건 공식문서임
위에처럼 부모안에 자식컴포넌트 추가해서 className 달아서 부모랑 자식 연결해서
.className 선택자로 스타일링 하려고 함
import React from 'react';
import styled from 'styled-components';
import ButtonComponent from './button';
const Container = styled.ul`
display: flex;
align-items: center;
justify-content: space-between;
.land {
opacity: 0.1;
}
`;
type ConstructionProps = {};
function Construction({}: ConstructionProps) {
return (
<Container>
<ButtonComponent
className={'land'}
icon={<i className='fas fa-flag'></i>}
name='땅'
callback={() => {
console.log('buttonClick');
}}
></ButtonComponent>
간단하게 자식요소 opacity: 0.1이 작동하는지 확인하려 했는데 잘 안됨 ㅠㅠ
원래 외부에서 import한 컴포넌트는 안됨???????
클래스네임이 프리픽스 되지 않는지 개발자도구를 열어봐
아 시발 미안 해결했다. 내가 자식컴포넌트에서 props 타입에다가 className만 선언해두고 정작 element에 classsName을 지정 안함 ㅋㅋㅋ