Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@uppy/react's new useUppyState breaking support for React 16/17? #4783

Closed
2 tasks done
skjelmo opened this issue Nov 9, 2023 · 1 comment
Closed
2 tasks done

@uppy/react's new useUppyState breaking support for React 16/17? #4783

skjelmo opened this issue Nov 9, 2023 · 1 comment
Labels

Comments

@skjelmo
Copy link

skjelmo commented Nov 9, 2023

Initial checklist

  • I understand this is a bug report and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Link to runnable example

https://codesandbox.io/p/sandbox/stoic-easley-g6lstz

Steps to reproduce

Starting the sandbox should output:

ERROR in ./node_modules/@uppy/react/lib/useUppyState.js 5:9-29
export 'useSyncExternalStore' (imported as 'useSyncExternalStore') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)

Sandbox is using DashboardModal from @uppy/react in app/components/Root/Root.js

I get the same locally when compiling with webpack.

Expected behavior

Expected @uppy/react to compile with react 16 since it is a peerDependency.

Seems to fail because useSyncExternalStore imported by useUppyState.js is not available before react 18.

Actual behavior

Compilation fails.

@skjelmo skjelmo added the Bug label Nov 9, 2023
@arturi
Copy link
Contributor

arturi commented Nov 11, 2023

Hi, thank you for reporting. We are looking into this, will probably revert the change for now and issue a patch release. Apologies for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants