Skip to content

Commit

Permalink
Custom elements should have class set instead of className in React (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle authored May 30, 2023
1 parent be912b2 commit 93a7c3c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/silver-buckets-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/hydrogen-react': patch
'@shopify/hydrogen': patch
---

Fix `<ModelViewer>` to properly set className
5 changes: 3 additions & 2 deletions packages/hydrogen-react/src/ModelViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ export function ModelViewer(props: ModelViewerProps): JSX.Element | null {

return (
<model-viewer
// @ts-expect-error ref should exist
ref={callbackRef}
{...passthroughProps}
className={className}
// @ts-expect-error src should exist
// @eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
class={className}
id={passthroughProps.id ?? data.id}
src={data.sources[0].url}
alt={data.alt ?? null}
Expand Down

0 comments on commit 93a7c3c

Please sign in to comment.