cloudflare / cf-ui

:gem: Cloudflare UI Framework
Other
1.29k stars 81 forks source link

`cf-component-label` throws an error #234

Closed koddsson closed 7 years ago

koddsson commented 7 years ago

See: https://www.webpackbin.com/bins/-KlSz31gitKKN_SLzWkp for reproduction.

koddsson commented 7 years ago

This is actually a integration error that's not super apperent. I think it's just missing the fela context.

wyuenho commented 7 years ago

I think this is very surprising to me as well. I think we are moving towards providing both unstyled and styled components. cf-component-label has taken up this approach recently, but in reality, unstyled components are still styled, they are just "unthemed", and should be called as such.

A related issue is, I think we should also provide completely unstyled components. I'll file a ticket for that later to lay out the reason.

In short, I think you should be able to just import a real unstyled component and gets no error.

tajo commented 7 years ago

This is actually a integration error that's not super apperent. I think it's just missing the fela context.

Not a bug. It's missing the base theme. You would have to add <ThemeProvider> and pass down cf-style-const/variables to make your example working (also you missed required type prop for the label). Or just can just use cf-style-provider/<StyleProvider> that does all that.