How do I upgrade React from 0.13 to 15.0.1? - reactjs

Please tell me step by step process of upgrading React from version .13 to 15.0.1 .

Update react version in package.json
Delete node_modules folder
Run npm install
install process will fail if there is any version mismatch among other dependencies in package file, console will show the expected compatible version number. Update those and run npm install again.
Once install is complete, then build your application and test. If any error appear due to deprecated code, then you would have to fix those as well.
One of the deprecated syntax from ver 13, is usage of react.render
There you will have to import react-dom and use that to call render. There can be many other potential issues which you may encounter. So test you app properly.
React entries in package.json that I have:
"react": "15.0.1",
"react-addons-perf": "15.0.1",
"react-addons-test-utils": "15.0.1",
"react-addons-update": "15.0.1",
"react-dom": "15.0.1"
All the best!
P.S. This is the process I follow, there may be some other way to do it.

By experience I can say that each version of react-native has breaking changes, for example from version 17 on, you need to remove #override on
public List<Class<? extends JavaScriptModule>> createJSModules()
So my advice is update progressively along with all you project dependencies.

Related

WARNING: You are currently running a version of TypeScript which is not officially supported by #typescript-eslint/typescript-estree

Hello there I am getting some error in my terminal and its say i need to use 4.4.0 version and my current version is ...
In my project my current typescript version is given below,
"typescript": "^4.4.2",
"typedoc": "^0.21.8",
"react-scripts": "^3.4.4",
"#typescript-eslint/eslint-plugin": "^4.29.3",
"#typescript-eslint/parser": "^4.29.3",
Moreover, when I am trying to run npm run dev commands or npx eslint . is error are showing me which is given below,
=============
WARNING: You are currently running a version of TypeScript which is not
officially supported by #typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.4.0
YOUR TYPESCRIPT VERSION: 4.4.2
Please only submit bug reports when using the officially supported
version.
=============
How can i fix this issue and I have done a lot of research in google but nothing is working. It would be great help for me.
I wouldn't downgrade my Typescript, as you will miss out on newer TS features - I would find a way to update #typescript-eslint/typescript-estree.
You might not have this installed directly and this might be a dependancy of another package, #typescript-eslint/experimental-utils which is dependancy of #typescript-eslint/eslint-plugin for instance, so track down the parent package in your yarn.lock / package.lock file and bump it, as a result it should bump #typescript-eslint/typescript-estree too.
Try using a typescript version between >=3.3.1 <4.4.0.
Here you have the list of typescript versions available.
After changing the version, remove node_modules folder and package-lock.json file. Then execute npm install

React-native/Libraries/Components/ScrollResponder could not be found

i actualize the node_module by doing nom install, then the doesn't work again and I became this error: Unable to resolve module react-native/Libraries/Components/ScrollResponder from /Users/project/node_modules/deprecated-react-native-listview/index.js: react-native/Libraries/Components/ScrollResponder could not be found within the project or in these directories:
node_modules
../node_modules.
in Package.json I have this version of react-native
"react": "^17.0.2",
"react-native": "^0.66.0",
...
Please help me I am a beginner, thanks a lot
I had this problem with version 0.0.6 of deprecated-react-native-listview but version 0.0.7 has a fix for this.
I take a look at react-native source code and I realized that ScrollResponder component was removed when react-native v0.65. Your react-native version is 0.66.0 therefore get this error.
Check the diff react-native v0.64 with v0.65 here: https://github.com/facebook/react-native/compare/0.64-stable...0.65-stable
You can consider downgrading your react-native version or use an alternative component instead of deprecated-react-native-listview.

How to update pre-existing dependency when using create-react-app?

I am using create-react-app for a project. I installed various eslint plugins etc, however, we all know that create-react-app already comes with certain dependencies that are not shown in package.json.
I want the newest eslint version which is currently 5.3.0. Create-react-app comes with 5.16.0. WITHOUT EJECTING, how do I bring this dependency to the newest version without breaking everything?
I get the following error:
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^5.16.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
:\node_modules\eslint (version: 5.3.0)
Things in package.json will take precedence so if you upgrade version of eslint, react-scripts should always take the latest version.
There is a small loophole though. If you fiddle too much with dependencies you might get the warning about mismatch version by react-scripts. To avoid that you can create .env file and can specify the following.
SKIP_PREFLIGHT_CHECK=true
I just solved this issue, the error says:
The react-scripts package provided by Create React App requires a dependency:
"eslint": "5.16.0"
but also says you have another version at package.json that's
\node_modules\eslint (version: 5.3.0) in my case was 6.1.0
so my solution was:
I searched for the dependency called eslint and updated the version similar to Create React App expected "eslint": "^5.16.0" at package.json
Then run npm install and now you can run npm start... if you have troubles with slint-plugin-import just update the version as well.

create-react-app using old version of react

I'm using create-react-app and have updated react and react-dom to later versions, yet when I console log the version of react being used, it's still showing an older version.
package.json
"react": "^16.3.0",
...
"react-dom": "^16.3.0",
Then I log the version used:
console.log('React.version', React.version);
And it tells me:
React.version 15.6.2
How can I get create-react-app to use the newer version?
Reason for update, I want to use React Context which is only available from version 16.3.0+

How to update react native

I am currently on version 0.45.1 which is pretty old. And I am trying to upgrade it so that other dependencies work as expected (they updated their libraries and they require 0.46.1 and above).
I am following this process:
delete node_module folder
change react-native version number in package.json
run yarn cache clean
run watchman watch-del-all
run yarn so that dependencies get downloaded and linked
restart packager
reload app
App compiles and runs fine for "react-native": "^0.45.1", but some dependencies don't behave right (and they require 0.46 and above).
Attempt to upgrade to 0.46.0:
I set react-native version number in package.json to "react-native": "^0.46.0", and I follow the above process. I get this error:
Unable to resolve module 'react-native/Libraries/Renderer/src/renderers/native/ReactNativePropRegistry' from '/Users/MyUser/Projects/MyProject/node_modules/native-base/Components/Widgets/Button.js': Module does not exist in the module map
Attempt to upgrade to 0.47.0:
I get same error as above.
Attempt to upgrade to 0.48.0 (newest RN version):
I get same error as above.
Any help?
This error indicates a version conflict. You need to change the version of the native base. Native base compatibility versions https://github.com/GeekyAnts/NativeBase#6-compatibility-versions

Resources