helpscout / hsds-react

Help Scout Design System (HSDS) — React Component Library
MIT License
86 stars 17 forks source link

Allow providing head prop to the Frame component #1034

Closed jakubjanczyk closed 2 years ago

jakubjanczyk commented 2 years ago

Problem/Feature

Context: In Beacon embed we are migrating from React to Preact, for smaller bundle size and better speed. However, there's one issue with combination of Preact portals and frame component library we are using. This library always wants to create 2 portals, one for content and other for head element provided via props (even if it's not provided). But Preact is breaking when null element is provided (that is happening in this case).

I believe this might be something to be fixed in both Preact and frame library (I'll be creating some PRs to fix those), but just setting some empty head tag is quicker solution and we need HSDS Frame component to provide this head prop to the actual frame component. Before this change, head was filtered out by getValidProps function.

Guidelines

Make sure the pull request:

cloudflare-pages[bot] commented 2 years ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 87719af
Status: ✅  Deploy successful!
Preview URL: https://5456a915.hsds-react.pages.dev

View logs

tinkertrain commented 2 years ago

Incorporated into https://github.com/helpscout/hsds-react/pull/1035