andreypopp / andreypopp/react-css-components

Fix react unkown props

Đang mở
#17 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
help wanted
Ngôn ngữ chính
JavaScript
Star
672
Fork
14
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

when using the following syntax with React `15.x`
```css
Label {}
Label:prop(mode == 'edit') {}
```
```jsx

```
React throws the following error:
```
Warning: Unknown prop `mode` on

tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
```
If I understand correctly what is being said [here](https://gist.github.com/jimfb/d99e0678e9da715ccf6454961ef04d1b), you should be able to remove unknown props. Basically, that means that the syntax you are currently using should be deprecated.
I would suggest keeping to the `variant` prop:
```jsx

```
Tell me what you think.

**EDIT:** On second thoughts, the syntax is still very useful in many cases. For instance, you could choose to change the style of the component when `onClick` prop is set. I think it should be clearer in the doc that the library does not whitelist the props, and that you should use this feature only with props the component accepts.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.