couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 126 forks source link

v4: RenderAs type errors for GatsbyLink (e.g. - but I suspect any customized component type would fail) #314

Closed davepwsmith closed 3 years ago

davepwsmith commented 3 years ago

image

Having the type as seems to have a dual effect of expecting multiple children, and also preventing other typed components being used for renderAs.

Changing export type RenderAsComponent = string | React.ComponentType<never> to export type RenderAsComponent = string | React.ComponentType or export type RenderAsComponent = string | React.ComponentType<any>

Both seem to fix the problem, but not sure what the side effects would be.

Are you looking to explicitly prevent people from using other components in renderAs? Because that will basically prevent people from using this with Gatsby I think?

davepwsmith commented 3 years ago

I suspect that what is actually wanted here is React.ElementType? This would allow to render as all components, and also as basic intrinsic HTML types such as and

. Happy to PR this if that's the case.

couds commented 3 years ago

@davepwsmith Yes please open the PR =)

Thanks