Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've migrated two applications from React 15 to 16 and it was completely painless. I only had to bump all dependencies to the latest version.

Literally the only reason a migration could be painful if you're on the latest version of 15 before upgrading is that your code or your dependencies are using deprecated APIs, which the latest version of React 15 will helpfully warn about. You can fix that before migrating.



You probably weren’t mutating props...

My eyes kinda got wide when I read that part.


To be fair, mutating props was frowned upon pretty early on. Also, emphasis on upgrading to the latest version of React 15 before upgrading to React 16.

React has pretty thorough deprecation warnings on the final releases of each major version about what is going away with the next major. Once you've gotten rid of all deprecation warnings, migrating to the next major should be uneventful.

This means you can take your sweet time when upgrading, migrating your code without breaking your entire application.


> To be fair, mutating props was frowned upon pretty early on.

Yeah that’s what I’m saying :)


The Discord article authors are incorrect in saying mutating props broke with React 16.

What really happened is that they switched from createClass to ES6 classes. ES6 class methods have implicit 'use strict' mode.

They weren't forced to switch to ES6 classes if they didn't want to. createClass is on npm (create-react-class) and still works fine.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: