Skip to content

Commit

Permalink
use-sync-external-store: Add exports field to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Sep 10, 2022
1 parent 3613284 commit 3cf0eb2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions packages/use-sync-external-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
"name": "use-sync-external-store",
"description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.",
"version": "1.2.0",
"exports": {
".": "./index.js",
"./with-selector": "./with-selector.js",
"./shim": {
"react-native": "./shim/index.native.js",
"default": "./shim/index.js"
},
"./shim/index.native": "./shim/index.native.js",
"./shim/with-selector": "./shim/with-selector.js",
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import * as React from 'react';
import is from 'shared/objectIs';
import {useSyncExternalStore} from 'use-sync-external-store/src/useSyncExternalStore';
import {useSyncExternalStore} from './useSyncExternalStore';

// Intentionally not using named imports because Rollup uses dynamic dispatch
// for CommonJS interop.
Expand Down
2 changes: 1 addition & 1 deletion packages/use-sync-external-store/with-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

'use strict';

export {useSyncExternalStoreWithSelector} from 'use-sync-external-store/src/useSyncExternalStoreWithSelector';
export {useSyncExternalStoreWithSelector} from './src/useSyncExternalStoreWithSelector';

0 comments on commit 3cf0eb2

Please sign in to comment.