Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Component를 Styeld Components로 감쌌을 때 에러 해결 #50

Open
BKJang opened this issue Apr 5, 2020 · 0 comments
Open
Labels
completed This is completed. React This is related to React.

Comments

@BKJang
Copy link
Owner

BKJang commented Apr 5, 2020

❗️ How did I encounter this issue?

External Component를 styled-componets를 이용해서 styling을 하는 과정에서 넘긴 property를 Styled Component에서 그대로 받아썼다.

그 결과, 다음과 같은 에러가 발생했다.

Warning: React does not recognize the '[프로퍼티 명]' prop on a DOM element.

🔨 What have I tried? How did you finally solve it?

const Input = styled(({ isDirty, ...rest }) => (
  <StyledInput {...rest} />
))`
  ${({ isDirty }) =>
    isDirty &&
    css`
      border: 1px solid rgba(48, 61, 220, 0.25);
      background: rgba(142, 172, 255, 0.07);
    `};
`;

🙏 Reference

@BKJang BKJang added React This is related to React. completed This is completed. labels Apr 5, 2020
@BKJang BKJang changed the title External Component를 Styeld Components로 감쌌을 때 External Component를 Styeld Components로 감쌌을 때 에러 해결 Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This is completed. React This is related to React.
Projects
None yet
Development

No branches or pull requests

1 participant