SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
284 stars 134 forks source link

[BUG] Default Link component hasn't children type in template-retail-react-app. #893

Open GoodNightBuddy opened 1 year ago

GoodNightBuddy commented 1 year ago

Summary

When creating typed .tsx component that contain project default Link component, which contains children, there is an typescript error.

Steps To Reproduce

Create .tsx component. Import default Link component. Add some children into Link component.

Expected result

No error

Actual result

Type '{ children: Element; key: any; to: string; }' is not assignable to type 'IntrinsicAttributes & RefAttributes<any>'.

System Information (as applicable)

pwa-kit version:2.4.1"

Additional information

As I understand, react component must explicitly return children if it receives. But I do not know idea of the Link. Maybe creators originally conceived that Link should not receive any children. But I saw code above in PWA Web Kit and Managed Runtime: Developer Essentials. It did not throw error because it was .jsx. And, for example, Link from chakra receives children.

image

git2gus[bot] commented 1 year ago

This issue has been linked to a new work item: W-12355831