SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
444 stars 101 forks source link

Types: ReducedReactNode/UI5WCSlotsNode #4047

Closed arhigod closed 1 year ago

arhigod commented 1 year ago

Describe the bug Here was created a new type ReducedReactNode which excluded ReactFragment. And for now we have TS errors in all places, where the new type UI5WCSlotsNode is used, like this: image In this example we try to use common Icon in common MessageStrip.

Could you please check this

Lukas742 commented 1 year ago

Hi @arhigod

I wasn't able to reproduce this issue. (See here)

Could you please create a reproducible example? You can leverage the codeSandbox I posted above.

Lukas742 commented 1 year ago

With support of @ej612, we were able to reproduce this behavior and pin the root cause to React v17 & v16 as the types for ReactNode differ with these versions. The linked PR will fix this issue.

arhigod commented 1 year ago

@Lukas742 Thanks a lot. I tried to reproduce something in the sandbox, but now even the default template is crashing there for me :( image

Lukas742 commented 1 year ago

Hi @arhigod

You're welcome. :) I believe codeSandbox has problems resolving some type modules. Not sure why this is happening though. That's why I used the beta instance of codeSandbox as example above, because there this issue does not occur.

ui5-webcomponents-react-bot commented 1 year ago

:tada: This issue has been resolved in version v1.8.1 :tada:

The release is available on v1.8.1

Your semantic-release bot :package::rocket:

Lukas742 commented 1 year ago

Hi @arhigod

the example you provided differs from the one shown in the error message.

There it says that messageStripProps?.icon can be an empty string which is not supported. Could you please double check your implementation?

--> "" && <Component /> will return "" as Boolean("") is false and therefore the chain stops there. So I guess the updated types have already bore fruit, by exposing a possible bug ;)