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

Migrating to react 18 #105

Open
fixer26rus opened this issue Feb 1, 2023 · 11 comments
Open

Migrating to react 18 #105

fixer26rus opened this issue Feb 1, 2023 · 11 comments

Comments

@fixer26rus
Copy link

Is there any plans to migrate to react 18?

@JacobDel
Copy link

nope, dead repo

@mariaSlimani
Copy link

Hey, I forked the repo and I'm trying to migrate to react 18. Did get it working but I'm still getting some legacy warnings here and there. Hopefully I'll get it working.

@JacobDel
Copy link

let me know if I can help

Would be nice if we could merge with original repo somehow

@JacobDel
Copy link

@mariaSlimani I solved the legacy warning. I replaced the deprecated context with React.useContext. Works great for my application

React:https://github.com/JacobDel/avataaars
React native:https://github.com/JacobDel/react-native-avataaars

@mariaSlimani
Copy link

Hey @JacobDel ! first, thanks for taking the initiative! (if you saw the mess my commits were, you'd have figured I was having trouble with it XD).
I tested your code (installed the package into the react app i'm working on, using npm install JacobDel/avataaars) unfortunately i got this error (not warning):
react_1.default is undefined ./node_modules/avataaars/dist/options/OptionContext.js@http://192.168.1.34:3001/static/js/bundle.js:17336:1 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./node_modules/avataaars/dist/options/index.js@http://192.168.1.34:3001/static/js/bundle.js:17497:42 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./node_modules/avataaars/dist/avatar/top/accessories/index.js@http://192.168.1.34:3001/static/js/bundle.js:16316:36 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./node_modules/avataaars/dist/avatar/index.js@http://192.168.1.34:3001/static/js/bundle.js:10587:40 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./node_modules/avataaars/dist/index.js@http://192.168.1.34:3001/static/js/bundle.js:17036:35 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./src/components/RandomAvatar.js@http://192.168.1.34:3001/static/js/bundle.js:680:86 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./src/containers/Chatbot.js@http://192.168.1.34:3001/static/js/bundle.js:954:101 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./src/containers/LandingPage.js@http://192.168.1.34:3001/static/js/bundle.js:1349:85 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./src/containers/App.js@http://192.168.1.34:3001/static/js/bundle.js:851:89 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 fn@http://192.168.1.34:3001/static/js/bundle.js:101295:21 ./src/index.js@http://192.168.1.34:3001/static/js/bundle.js:1533:92 options.factory@http://192.168.1.34:3001/static/js/bundle.js:101638:31 __webpack_require__@http://192.168.1.34:3001/static/js/bundle.js:101056:33 @http://192.168.1.34:3001/static/js/bundle.js:102284:56 @http://192.168.1.34:3001/static/js/bundle.js:102286:12

My app works normally when i install my version using npm install mariaSlimani/avataaars (if we were to ignore the warnings that is).

@JacobDel
Copy link

JacobDel commented Aug 13, 2023

I forgot to build it to the dest folder (was testing it with src files). Does it work now?
btw we have a conflicting yarn version. It might help if you delete the yarn.lock file and run yarn install

@mariaSlimani
Copy link

Now when i install it I get :
OptionContext.js:124 Uncaught TypeError: Cannot read properties of undefined (reading 'createContext') at ./node_modules/avataaars/dist/options/OptionContext.js (OptionContext.js:124:1) at options.factory (react refresh:6:1) at __webpack_require__ (bootstrap:24:1) at fn (hot module replacement:62:1) at ./node_modules/avataaars/dist/options/index.js (index.js:7:1) at options.factory (react refresh:6:1) at __webpack_require__ (bootstrap:24:1) at fn (hot module replacement:62:1) at ./node_modules/avataaars/dist/avatar/top/accessories/index.js (index.js:26:1) at options.factory (react refresh:6:1)

@JacobDel
Copy link

I found the issue, I'm working on it

@JacobDel
Copy link

should be fixed @mariaSlimani

@mariaSlimani
Copy link

Unfortunately not. Here's the error :

image

  • It just kept going (notice the number of errors at the top (it just kept on increasing).

@JacobDel
Copy link

JacobDel commented Sep 2, 2023

Is it fixed now @mariaSlimani ?

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

No branches or pull requests

3 participants