Tutorial: Convert React.createClass to React.Component
How to get a component written with React.createClass to work in later versions of React.
This example contains code only, for full instructions visit https://mattwatson.codes/broken-react-createclass-component-lets-fix-it/ and https://mattwatson.test/converting-react-createclass-to-react-component/
This tutorial covers three steps:
- Loading a broken React component that has been built using
- Patching the React component by replacing
- Rebuilding the component to use
I am using a WordPress Block Editor (Gutenberg) plugin to test the components, so there are a few WP plugin files in this build, however you can find the relevent files you need in the following locations:
/components/original/react-checkbox-list/Checkboxlist.js(note the original licencing information is located here.
Note that I have submitted a Pull Request based on this tutorial so Sony can update it as appropriate.