fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.58k stars 692 forks source link

Error: export 'useSyncExternalStore' (imported as 'r') was not found in 'react' #1072

Closed ViniciusTxr closed 7 months ago

ViniciusTxr commented 7 months ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

ERROR in ./node_modules/react-toastify/dist/react-toastify.esm.mjs 243:12-13 export 'useSyncExternalStore' (imported as 'r') 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)

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

ps: the version 9.1.3 from react-toastify works fine

fkhadra commented 7 months ago

Hey @ViniciusTxr the v10 only works with react >= 18. Can't you upgrade to a more recent version of react?

ViniciusTxr commented 7 months ago

ohhhh ok @fkhadra , thanks for your support!!

Some adjustment points for you, in all the documentation (both package.json and the installation page) it says that this version is compatible with the react version >= 16.8

One suggestion is to adjust these parts so as not to cause confusion for other people :D And also add this information to the doc page 'migration-v10'

- package.json -> peerDependencies

- https://fkhadra.github.io/react-toastify/installation -> Requirements

codebycarlos commented 4 months ago

Came across this too, documentation says react version >= 16.8 image