Skip to content

Commit

Permalink
Remove dependency on use-sync-external-store
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

React Native requires React 18 which includes `useSyncExternalStore`, so we can remove the shim. It was only used in one place (`useColorScheme`).

Reviewed By: motiz88

Differential Revision: D44163914

fbshipit-source-id: 3a94466b3d5ae8aa43e9236acb8c92fbefd04180
  • Loading branch information
jajanut authored and jeongshin committed May 7, 2023
1 parent 4a0d444 commit 614a71f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 28 deletions.
1 change: 0 additions & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ rn_library(
"//xplat/js:node_modules__react_19shallow_19renderer",
"//xplat/js:node_modules__regenerator_19runtime",
"//xplat/js:node_modules__stacktrace_19parser",
"//xplat/js:node_modules__use_19sync_19external_19store",
"//xplat/js:node_modules__whatwg_19fetch",
"//xplat/js/RKJSModules/Libraries/Polyfills:Polyfills",
"//xplat/js/RKJSModules/Libraries/React:React",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import type {ColorSchemeName} from './NativeAppearance';

import Appearance from './Appearance';
import {useSyncExternalStore} from 'use-sync-external-store/shim';
import {useSyncExternalStore} from 'react';

export default function useColorScheme(): ?ColorSchemeName {
return useSyncExternalStore(
Expand Down
20 changes: 0 additions & 20 deletions packages/react-native/flow/use-sync-external-store.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
"regenerator-runtime": "^0.13.2",
"scheduler": "^0.23.0",
"stacktrace-parser": "^0.1.10",
"use-sync-external-store": "^1.0.0",
"whatwg-fetch": "^3.0.0",
"ws": "^6.2.2",
"yargs": "^17.6.2"
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8509,11 +8509,6 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"

use-sync-external-store@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz#d98f4a9c2e73d0f958e7e2d2c2bfb5f618cbd8fd"
integrity sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw==

util-deprecate@^1.0.1, util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
Expand Down

0 comments on commit 614a71f

Please sign in to comment.