Skip to content

Commit

Permalink
Move react to peer deps in Hydrogen (#1439)
Browse files Browse the repository at this point in the history
* Move React to peer deps

* Use type imports

* Changesets
  • Loading branch information
frandiox authored Oct 22, 2023
1 parent d2f4737 commit f5b0573
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-parrots-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/hydrogen': patch
---

Move `react` to peer dependencies. It had been added as a direct dependency by mistake in a previous version.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@
],
"dependencies": {
"@shopify/hydrogen-react": "2023.7.4",
"react": "^18.2.0",
"content-security-policy-builder": "^2.1.1"
},
"peerDependencies": {
"@remix-run/react": "1.19.1",
"@remix-run/server-runtime": "1.19.1"
"@remix-run/server-runtime": "1.19.1",
"react": "^18.2.0"
},
"devDependencies": {
"@testing-library/react": "^14.0.0",
"happy-dom": "^8.9.0",
"react": "^18.2.0",
"schema-dts": "^1.1.0",
"vitest": "^0.33.0",
"@shopify/generate-docs": "0.11.1"
Expand Down
6 changes: 2 additions & 4 deletions packages/hydrogen/src/cart/CartForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type FetcherWithComponents, useFetcher} from '@remix-run/react';
import {type MetafieldWithoutOwnerId} from './queries/cart-types';
import React from 'react';
import type {ReactNode} from 'react';
import {
AttributeInput,
CartBuyerIdentityInput,
Expand Down Expand Up @@ -173,9 +173,7 @@ type CartFormCommonProps = {
* Children nodes of CartForm.
* Children can be a render prop that receives the fetcher.
*/
children:
| React.ReactNode
| ((fetcher: FetcherWithComponents<any>) => React.ReactNode);
children: ReactNode | ((fetcher: FetcherWithComponents<any>) => ReactNode);
/**
* The route to submit the form to. Defaults to the current route.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/src/product/VariantSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
ProductVariantConnection,
SelectedOptionInput,
} from '@shopify/hydrogen-react/storefront-api-types';
import {ReactNode, useMemo, createElement, Fragment} from 'react';
import {type ReactNode, useMemo, createElement, Fragment} from 'react';
import type {PartialDeep} from 'type-fest';

export type VariantOption = {
Expand Down

0 comments on commit f5b0573

Please sign in to comment.