Skip to content

Come here if you want to make it work with react 17 or 18 #82

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

Open
Oskku opened this issue Nov 4, 2022 · 0 comments
Open

Come here if you want to make it work with react 17 or 18 #82

Oskku opened this issue Nov 4, 2022 · 0 comments

Comments

@Oskku
Copy link
Contributor

Oskku commented Nov 4, 2022

This is what worked for me:
First, change the react version to 17 in your project make npm install --legacy-peer to the project,
then go to node_modules and copy the react-notification-system file out of the node module, for example, I create a file called forked in the root of the project and I drag the copied react notification system inside it, then I go inside the copied react

notification system and I add the changes you can check them in this forked git: https://github.com/Osamah-learn/react-notification-system
if you use redux in your project then you need to react notification system redux which I also make a change for it from the link below: https://github.com/Osamah-learn/react-notification-system-redux
remember to do the same when you change your react version and make npm install --legacy-peer take react-notification-system-redux from there into the forked file where you put it in the root of the project
Let's assume you make the changes to the React notification system and redux system, it will be nicer to let them work locally with your work project, the way I did after playing around with the npm link i found the steps below the best option to make things work so this is how it goes:
Run the forked library locally
STEP 1: In the module project, execute first yarn to build the node module then run npm pack:
This will build a -.tar.gz file.

STEP 2: Move the file to the consumer project
Ideally, you can put all such files in a temp folder in your consumer-project root:

STEP 3: Refer it in your package.json:
"dependencies": {
"my-package": "file:/./tmp/my-package-1.3.3.tar.gz"
}
STEP 4: Install the packages:
npm install or npm i or yarn

Now, your package would be available in your consumer project's node_modules folder.
Good Luck...

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

1 participant