callstack / callstack/react-theme-provider

Example of using `withTheme` with Flow

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

Mô tả

I create a component with `Props` type that includes a theme:

```js
type Props = {
theme: MyTheme,
otherProps: any,
};

class MyCmp extends PureComponent { ... }
```

Then I export it like this:

```js
export withTheme(MyCmp);
```

Then when I import it and use in JSX I'm getting a Flow error that `theme` prop is required.

What is the idiomatic example of defining `withTheme` component with Flow?

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

Mở hướng dẫn đóng góp

Đá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.