{"id":228357,"date":"2022-10-12T11:34:00","date_gmt":"2022-10-12T08:34:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=228357"},"modified":"2022-11-09T02:02:25","modified_gmt":"2022-11-08T23:02:25","slug":"zlamanij-komponent-react-createclass-davajte-vipravimo-ce","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/zlamanij-komponent-react-createclass-davajte-vipravimo-ce\/","title":{"rendered":"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!"},"content":{"rendered":"\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u0442\u0435 WordPress Gutenberg Blocks (\u0430\u0431\u043e \u043d\u0430\u0432\u0456\u0442\u044c \u044f\u043a\u0449\u043e \u0432\u0438 \u043d\u0456), \u043c\u043e\u0436\u043b\u0438\u0432\u043e, \u0432\u0438 \u043d\u0430\u043c\u0430\u0433\u0430\u0454\u0442\u0435\u0441\u044f <a href=\"https:\/\/wholesomecode.ltd\/blog\/add-select2-as-an-inspectorcontrol-in-wordpress-gutenberg\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0437\u043c\u0443\u0441\u0438\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0456\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438 \u0443 \u0432\u0430\u0448\u0456\u0439 \u0437\u0431\u0456\u0440\u0446\u0456<\/a>. \u0410\u043b\u0435 \u044f\u043a\u0449\u043e \u0446\u0435 \u0441\u0442\u0430\u0440\u0456\u0448\u0438\u0439 \u0435\u043b\u0435\u043c\u0435\u043d\u0442, \u0437\u043e\u043a\u0440\u0435\u043c\u0430 \u0442\u043e\u0439, \u044f\u043a\u0438\u0439 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454 \u0437\u0430\u0441\u0442\u0430\u0440\u0456\u043b\u0438\u0439 <code>React.createClass<\/code>\u043c\u0435\u0442\u043e\u0434, \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0441\u0442\u0440\u044f\u0433\u0442\u0438.<\/p>\n<p>\u0424\u0430\u0439\u043b\u0438, \u044f\u043a\u0456 \u0441\u0443\u043f\u0440\u043e\u0432\u043e\u0434\u0436\u0443\u044e\u0442\u044c \u0446\u0435\u0439 \u043f\u0456\u0434\u0440\u0443\u0447\u043d\u0438\u043a, \u0437\u043d\u0430\u0445\u043e\u0434\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0440\u0438\u0433\u0456\u043d\u0430\u043b\u044c\u043d\u0438\u0445 \u043f\u0430\u043f\u043a\u0430\u0445 \u0456 \u0432\u0438\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0445 \u043f\u0430\u043f\u043a\u0430\u0445 \u0443 \u043f\u0430\u043f\u0446\u0456 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0456\u0432 \u0440\u0456\u0448\u0435\u043d\u043d\u044f GitHub.<\/p>\n<p><a href=\"https:\/\/github.com\/mattwatsoncodes\/Tutorial-Convert-React-createClass-to-React-Component\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u041e\u0442\u0440\u0438\u043c\u0430\u0439\u0442\u0435 \u043d\u0430\u0432\u0447\u0430\u043b\u044c\u043d\u0456 \u0444\u0430\u0439\u043b\u0438 \u0437 GitHub<\/a><\/p>\n<p>\u042f \u0448\u0443\u043a\u0430\u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0430\u043f\u043e\u0440\u0446\u0456\u0432, \u044f\u043a\u0438\u0439 \u0434\u043e\u0437\u0432\u043e\u043b\u0438\u0432 \u0431\u0438 \u043c\u0435\u043d\u0456 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0438 \u043d\u0430\u0431\u0456\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0456\u0432 (\u043f\u043e\u0434\u0456\u0431\u043d\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u044f\u043a \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0456\u0432 <code>&lt;SelectControl\/&gt;<\/code>\u0443 WordPress Gutenberg). \u0412\u0431\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0439 <code>&lt;CheckboxControl\/&gt;<\/code>\u043d\u0435 \u043c\u0430\u0432 \u043e\u043f\u0446\u0456\u0457, \u0430\u043b\u0435 \u043f\u0456\u0441\u043b\u044f \u0434\u0435\u044f\u043a\u043e\u0433\u043e \u043f\u043e\u0448\u0443\u043a\u0443 \u0432 \u0406\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0456 \u044f \u0437\u043d\u0430\u0439\u0448\u043e\u0432 <code>[react-checkbox-list](https:\/\/github.com\/sonyan\/react-checkbox-list)<\/code> <a href=\"https:\/\/github.com\/sonyan\/react-checkbox-list\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">Sony An<\/a> (\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439 \u044f\u043a <a href=\"https:\/\/www.npmjs.com\/package\/react-checkbox-list\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\"><code>react-checkbox-list<\/code>\u043d\u0430 npm<\/a> ).<\/p>\n<p>\u0426\u0435 \u0437\u0440\u043e\u0431\u0438\u043b\u043e \u0432\u0441\u0435, \u0449\u043e \u044f \u0445\u043e\u0442\u0456\u0432, \u0430\u043b\u0435 \u043f\u0456\u0441\u043b\u044f \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f \u0447\u0435\u0440\u0435\u0437 npm (<code>npm install react-checkbox-list --save<\/code>) \u0446\u0435 \u043d\u0435 \u0441\u043f\u0440\u0430\u0446\u044e\u0432\u0430\u043b\u043e. \u042f \u0437\u043d\u0430\u0432, \u0449\u043e \u043c\u0435\u043d\u0456 \u0434\u043e\u0432\u0435\u0434\u0435\u0442\u044c\u0441\u044f \u0440\u043e\u0437\u0433\u0430\u043b\u0443\u0436\u0443\u0432\u0430\u0442\u0438 \u0442\u0430 \u0432\u0438\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u0438 \u043f\u043b\u0430\u0433\u0456\u043d.<\/p>\n<p>\u0417\u0430\u0443\u0432\u0430\u0436\u0442\u0435, \u0449\u043e \u0446\u0435\u0439 \u043f\u0456\u0434\u0440\u0443\u0447\u043d\u0438\u043a \u043e\u0445\u043e\u043f\u043b\u044e\u0454 \u0432\u0438\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044f \u0456\u0441\u043d\u0443\u044e\u0447\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u0456\u0432 <code>React.createClass<\/code>\u0456. <a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u042f\u043a\u0449\u043e \u0432\u0438 \u0437\u0430\u0446\u0456\u043a\u0430\u0432\u043b\u0435\u043d\u0456 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e\u0431 \u0434\u0456\u0437\u043d\u0430\u0442\u0438\u0441\u044f, \u044f\u043a \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u0442\u0438 \u0457\u0445 \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0431\u0430\u0436\u0430\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f<\/a> <a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">, \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u043d\u044c\u0442\u0435 \u043f\u0443\u0431\u043b\u0456\u043a\u0430\u0446\u0456\u044e \u043d\u0430 \u0446\u044e \u0442\u0435\u043c\u0443<\/a>.<code>React.propTypes<\/code><a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external\"><\/a> <code>[React.Component](https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/)<\/code><a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external\"><\/a><\/p>\n<h2>\u0412\u0438\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 React<\/h2>\n<p>\u041f\u0435\u0440\u0448\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0437 \u044f\u043a\u043e\u044e \u0432\u0438 \u0437\u0456\u0442\u043a\u043d\u0435\u0442\u0435\u0441\u044f, \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0430\u0432\u0456\u0442\u044c \u043d\u0435 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u044c\u0441\u044f, \u0456 \u0432\u0430\u043c \u0431\u0443\u0434\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0434\u043e\u0441\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u0454\u043c\u043d\u0443 <code>Uncaught TypeError: Cannot read property 'array' of undefined<\/code>\u043f\u043e\u043c\u0438\u043b\u043a\u0443.<\/p>\n<p>Uncaught TypeError, \u043d\u0435\u043c\u043e\u0436\u043b\u0438\u0432\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0432\u043b\u0430\u0441\u0442\u0438\u0432\u0456\u0441\u0442\u044c &#8216;array&#8217; \u043d\u0435\u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e\u0433\u043e<\/p>\n<p>\u0426\u0435 \u0442\u043e\u043c\u0443, \u0449\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0438\u0439 \u0440\u044f\u0434\u043e\u043a <code>defaultData: React.PropTypes.array,<\/code>, \u0456 \u0446\u0435 \u0442\u043e\u043c\u0443 <code>React.PropTypes<\/code>, \u0449\u043e \u0432\u0456\u043d \u043d\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-169379-61e80e28d135c.png\" alt=\"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!\" \/>React.PropTypes \u043d\u0435 \u0432\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043e<\/p>\n<p>\u041d\u0435\u0432\u0435\u043b\u0438\u043a\u0435 \u0434\u043e\u0441\u043b\u0456\u0434\u0436\u0435\u043d\u043d\u044f <a href=\"https:\/\/reactjs.org\/docs\/typechecking-with-proptypes.html\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0456\u0457 React \u043f\u043e\u043a\u0430\u0437\u0443\u0454, \u0449\u043e \u0432\u043e\u043d\u0430<\/a> <code>[React.PropTypes](https:\/\/reactjs.org\/docs\/typechecking-with-proptypes.html)<\/code> <a href=\"https:\/\/reactjs.org\/docs\/typechecking-with-proptypes.html\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u0430 \u0432 \u0456\u043d\u0448\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u0443 React \u0432\u0435\u0440\u0441\u0456\u0457 15.5<\/a>. \u0412\u0456\u043d \u0440\u0430\u0434\u0438\u0442\u044c \u043d\u0430\u043c \u0437\u0430\u043c\u0456\u0441\u0442\u044c \u0446\u044c\u043e\u0433\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443 prop-types.<\/p>\n<p>\u0412\u0456\u043d \u043d\u0430\u0432\u0456\u0442\u044c \u0434\u0430\u0454 \u0432\u0430\u043c \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u043d\u0430 <a href=\"https:\/\/www.npmjs.com\/package\/prop-types\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0439 npm \u0434\u043b\u044f \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0438 prop-types<\/a>. \u041e\u0442\u0436\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u043e \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443 prop-types.<\/p>\n<pre><code>npm install --save prop-types\n<\/code><\/pre>\n<p>\u0423 \u0432\u0435\u0440\u0445\u043d\u0456\u0439 \u0447\u0430\u0441\u0442\u0438\u043d\u0456 \u043d\u0430\u0448\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u0454\u043c\u043e <code>prop-types<\/code>\u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0443. <a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0421\u0443\u0447\u0430\u0441\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u0446\u044c\u043e\u0433\u043e \u0437\u043c\u0443\u0441\u0438\u0442\u044c \u043d\u0430\u0441 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438<\/a> <code>[import](https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/)<\/code> <a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/a>, \u0430\u043b\u0435 \u043f\u043e\u043a\u0438 \u0449\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043c\u043e \u0442\u043e\u0439 \u0441\u0430\u043c\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0434\u043e\u0434\u0430\u043d\u0438\u0439 <code>var PropTypes = require('prop-types');<\/code>\u0434\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0438\u0436\u0447\u0435, \u0434\u0435 \u043c\u0438 \u043e\u0433\u043e\u043b\u043e\u0448\u0443\u0454\u043c\u043e <code>React<\/code>. \u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0456\u044f \u0442\u0435\u043f\u0435\u0440 \u043c\u0430\u0454 \u0432\u0438\u0433\u043b\u044f\u0434\u0430\u0442\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>'use strict';\nvar React     = require('react');\nvar PropTypes = require('prop-types');\n\nmodule.exports = React.createClass({\n    displayName: 'CheckBoxList',\n\n    propTypes: {\n        defaultData: React.PropTypes.array,\n        onChange: React.PropTypes.func\n    },\n...\n<\/code><\/pre>\n<p>\u0427\u0443\u0434\u043e\u0432\u0430 \u0448\u0442\u0443\u043a\u0430! \u041e\u0434\u043d\u0430\u043a \u043c\u0438 \u0432\u0441\u0435 \u043e\u0434\u043d\u043e \u043e\u0442\u0440\u0438\u043c\u0443\u0454\u043c\u043e \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f \u043f\u0440\u043e <code>'array' of undefined<\/code>\u043f\u043e\u043c\u0438\u043b\u043a\u0443. \u0426\u0435 \u0442\u043e\u043c\u0443, \u0449\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, <code>React.PropTypes.array<\/code>\u0456 \u043c\u0438 \u0449\u043e\u0439\u043d\u043e \u043e\u0433\u043e\u043b\u043e\u0441\u0438\u043b\u0438 \u043d\u0430\u0448\u0456 PropTypes \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0437\u043c\u0456\u043d\u043d\u043e\u0457 <code>PropTypes<\/code>. \u041e\u0442\u0436\u0435, \u043f\u0440\u043e\u0441\u0442\u0435 \u0440\u0456\u0448\u0435\u043d\u043d\u044f \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e\u0431 \u0437\u043d\u0430\u0439\u0442\u0438 \u0442\u0430 \u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438 \u0432\u0441\u0456 \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0438 <code>React.PropTypes<\/code>\u043d\u0430 <code>PropTypes<\/code>.<\/p>\n<p>\u041d\u0430\u0448 \u043f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0443 \u0442\u0435\u043f\u0435\u0440 \u043c\u0430\u0454 \u0432\u0438\u0433\u043b\u044f\u0434\u0430\u0442\u0438 \u0442\u0430\u043a:<\/p>\n<pre><code>'use strict';\nvar React     = require('react');\nvar PropTypes = require('prop-types');\n\nmodule.exports = React.createClass({\n    displayName: 'CheckBoxList',\n\n    propTypes: {\n        defaultData: PropTypes.array,\n        onChange: PropTypes.func\n    },\n...\n<\/code><\/pre>\n<p>\u041e\u0442\u0436\u0435, \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 PropTypes \u0442\u0435\u043f\u0435\u0440 \u0432\u0438\u0440\u0456\u0448\u0435\u043d\u0430! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043d\u043e\u0432\u0438\u043c\u043e \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0456 \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u043c\u043e, \u0447\u0438 \u0432\u0456\u043d \u043f\u0440\u0430\u0446\u044e\u0454.<\/p>\n<p>\u041d\u0456, \u0442\u0435\u043f\u0435\u0440 \u043c\u0438 \u043e\u0442\u0440\u0438\u043c\u0443\u0454\u043c\u043e \u043f\u043e\u043c\u0438\u043b\u043a\u0443<code>Uncaught TypeError: React.createClass is not a function.<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-169379-61e80e28d135c.png\" alt=\"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!\" \/><img decoding=\"async\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-169379-61e80e29cc727.png\" alt=\"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!\" \/>Uncaught TypeError: React.createClass \u043d\u0435 \u0454 \u0444\u0443\u043d\u043a\u0446\u0456\u0454\u044e.\ufeff<\/p>\n<p>\u0417\u043d\u043e\u0432\u0443 \u0436 \u0442\u0430\u043a\u0438, \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u043f\u043e\u0448\u0443\u043a \u0443 <a href=\"https:\/\/reactjs.org\/blog\/2017\/04\/07\/react-v15.5.0.html#new-deprecation-warnings\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0456\u0457 React \u0456 \u043f\u0440\u0438\u043c\u0456\u0442\u043a\u0430\u0445 \u0434\u043e \u0432\u0438\u043f\u0443\u0441\u043a\u0443 \u0432\u0435\u0440\u0441\u0456\u0457 15.5.0<\/a> \u043f\u043e\u043a\u0430\u0437\u0443\u0454 \u043d\u0430\u043c, \u0449\u043e <code>React.createClass<\/code>\u0443 \u0432\u0435\u0440\u0441\u0456\u0457 15.5.0 \u0431\u0443\u043b\u043e \u0437\u043d\u0435\u0446\u0456\u043d\u0435\u043d\u043e.<\/p>\n<p>\u0420\u0430\u0437\u043e\u043c \u0456\u0437 <code>React.PropTypes<\/code>, <code>React.createClass<\/code>\u0431\u0443\u043b\u043e \u043f\u0435\u0440\u0435\u0440\u043e\u0431\u043b\u0435\u043d\u043e \u0443 \u0432\u043b\u0430\u0441\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 <a href=\"https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0434\u043b\u044f \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0456\u0432 React \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u043d\u0430\u0439\u043a\u0440\u0430\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434<\/a> <code>[React.Component](https:\/\/mattwatson.codes\/converting-react-createclass-to-react-component\/)<\/code>.<\/p>\n<p>\u0417\u0430\u043c\u0456\u043d\u0430 \u0434\u043b\u044f React.createClass \u0442\u0435\u043f\u0435\u0440 \u0443 \u0432\u043b\u0430\u0441\u043d\u043e\u043c\u0443 <a href=\"https:\/\/www.npmjs.com\/package\/create-react-class\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0456\u0457 npm \u044f\u043a create-react-class<\/a>. \u041e\u0442\u0436\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u043e \u0446\u0435 \u0432 \u043d\u0430\u0448\u0443 \u0437\u0431\u0456\u0440\u043a\u0443.<\/p>\n<pre><code>npm install --save create-react-class\n<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0456\u043c\u043f\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043a\u0435\u0442 \u0443 \u043d\u0430\u0448\u0443 \u0437\u0431\u0456\u0440\u043a\u0443, \u0437\u043d\u043e\u0432\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0448\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0443 \u043a\u043b\u0430\u0441\u0438\u0447\u043d\u043e\u043c\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0456, \u0434\u043e\u0434\u0430\u0442\u0438 \u0440\u044f\u0434\u043e\u043a <code>var CreateReactClass = require('create-react-class');<\/code>\u0443 \u0432\u0435\u0440\u0445\u043d\u0456\u0439 \u0447\u0430\u0441\u0442\u0438\u043d\u0456 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre><code>'use strict';\nvar React            = require('react');\nvar PropTypes        = require('prop-types');\nvar CreateReactClass = require('create-react-class');\n\nmodule.exports = React.createClass({\n    displayName: 'CheckBoxList',\n\n    propTypes: {\n        defaultData: PropTypes.array,\n        onChange: PropTypes.func\n    },\n...\n<\/code><\/pre>\n<p>\u0417\u043d\u043e\u0432\u0443 \u0436 \u0442\u0430\u043a\u0438, \u043d\u0430\u0448\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u043d\u0435 \u0437\u043d\u0438\u043a\u043d\u0435, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0437\u0430\u043c\u0456\u043d\u0438\u0442\u0438 \u0432\u0441\u0456 \u0435\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0438 <code>React.createClass<\/code>\u043d\u043e\u0432\u0438\u043c \u0456\u043c\u043f\u043e\u0440\u0442\u043e\u0432\u0430\u043d\u0438\u043c \u043e\u0431&#8217;\u0454\u043a\u0442\u043e\u043c <code>CreateReactClass<\/code>. \u0426\u0435 \u043c\u0430\u0454 \u0432\u0438\u0433\u043b\u044f\u0434\u0430\u0442\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code>'use strict';\nvar React            = require('react');\nvar PropTypes        = require('prop-types');\nvar CreateReactClass = require('create-react-class');\n\nmodule.exports = CreateReactClass({\n    displayName: 'CheckBoxList',\n\n    propTypes: {\n        defaultData: PropTypes.array,\n        onChange: PropTypes.func\n    },\n...\n<\/code><\/pre>\n<p>\u0406 \u0446\u0435 \u0432\u0441\u0435! \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0456\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u0438\u0434\u0430\u0454 \u043f\u043e\u043c\u0438\u043b\u043e\u043a, \u0456 \u043d\u0430\u0448\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c JavaScript \u0433\u0430\u0440\u043d\u0430 \u0442\u0430 \u0447\u0438\u0441\u0442\u0430.<\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u0435 \u0440\u0456\u0448\u0435\u043d\u043d\u044f \u0432\u0438\u0433\u043b\u044f\u0434\u0430\u0454 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-169379-61e80e2b09ef2.gif\" alt=\"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!\" \/>\u0412\u0438\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React Multiple Checklist \u0443 WordPress Gutenberg<\/p>\n<h2>\u0412\u0438\u0445\u0456\u0434\u043d\u0438\u0439 \u043a\u043e\u0434 \u043f\u0456\u0434\u0440\u0443\u0447\u043d\u0438\u043a\u0430<\/h2>\n<p>\u0412\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/wholesomecode\/Tutorial-Convert-React-createClass-to-React-Component\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0432\u0438\u0445\u0456\u0434\u043d\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0440\u0438\u0433\u0456\u043d\u0430\u043b\u044c\u043d\u043e\u0457 \u0442\u0430 \u0432\u0438\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e\u0457 \u0432\u0435\u0440\u0441\u0456\u0457 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043d\u0430 GitHub<\/a>. \u041f\u043b\u0430\u0433\u0456\u043d \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0431\u043b\u043e\u043a WordPress Gutenberg, \u044f\u043a\u0438\u0439 \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438, \u0449\u043e\u0431 \u043f\u043e\u0433\u0440\u0430\u0442\u0438 \u0437 \u043a\u043e\u0434\u043e\u043c, \u0456\u0437 \u0442\u0440\u044c\u043e\u043c\u0430 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u044f\u043a\u0456 \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438, \u044f\u043a\u0449\u043e \u0446\u0435 \u043d\u0435\u043e\u0431\u0445\u0456\u0434\u043d\u043e:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-169379-61e80e2cbb1fa.png\" alt=\"\u0417\u043b\u0430\u043c\u0430\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React.createClass? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0438\u043f\u0440\u0430\u0432\u0438\u043c\u043e \u0446\u0435!\" \/>\u0424\u0430\u0439\u043b\u0438 \u043f\u043e\u0441\u0456\u0431\u043d\u0438\u043a\u0456\u0432 GitHub \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0430 React.createClass<\/p>\n<h2>\u041d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0437\u0430\u043f\u0438\u0442\u0443 \u043d\u0430 \u0432\u0438\u0442\u044f\u0433 \u0434\u043e \u043e\u0440\u0438\u0433\u0456\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0445\u043e\u0432\u0438\u0449\u0430<\/h2>\n<p>\u0427\u0443\u0434\u043e\u0432\u0430 \u0440\u0456\u0447 \u0441\u043f\u0456\u043b\u044c\u043d\u043e\u0442\u0438 \u0437 \u0432\u0456\u0434\u043a\u0440\u0438\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u043e\u043b\u044f\u0433\u0430\u0454 \u0432 \u0442\u043e\u043c\u0443, \u0449\u043e \u043c\u0438 \u043c\u043e\u0436\u0435\u043c\u043e \u0432\u0456\u043b\u044c\u043d\u043e \u0440\u043e\u0431\u0438\u0442\u0438 \u0432\u043d\u0435\u0441\u043a\u0438 \u0442\u0430 \u043f\u043e\u043a\u0440\u0430\u0449\u0443\u0432\u0430\u0442\u0438 \u043a\u043e\u0434. \u041e\u0441\u044c <a href=\"https:\/\/github.com\/sonyan\/react-checkbox-list\/pull\/7\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">\u0437\u0430\u043f\u0438\u0442 \u043d\u0430 \u0432\u0438\u043b\u0443\u0447\u0435\u043d\u043d\u044f \u0437 \u0449\u043e\u0439\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u043c \u043c\u043d\u043e\u044e \u043f\u0430\u0442\u0447\u0435\u043c,<\/a> \u044f\u043a\u0438\u0439 \u044f \u043d\u0430\u0434\u0456\u0441\u043b\u0430\u0432 Sony An.<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0414\u0436\u0435\u0440\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0443:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/wholesomecode.ltd\" class=\"external external_icon\">wholesomecode.ltd<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u0441\u0442\u0432\u043e\u0440\u044e\u0454\u0442\u0435 \u0431\u043b\u043e\u043a\u0438 WordPress Gutenberg Blocks (\u0430\u0431\u043e \u043d\u0430\u0432\u0456\u0442\u044c \u044f\u043a\u0449\u043e \u0432\u0438 \u043d\u0456), \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043c\u0430\u0433\u0430\u0442\u0438\u0441\u044f \u0437\u043c\u0443\u0441\u0438\u0442\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0456\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 React \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438 \u0443 \u0432\u0430\u0448\u0456\u0439 \u0437\u0431\u0456\u0440\u0446\u0456. \u0410\u043b\u0435 \u044f\u043a\u0449\u043e \u0446\u0435 \u0441\u0442\u0430\u0440\u0456\u0448\u0438\u0439 \u0435\u043b\u0435\u043c\u0435\u043d\u0442,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":224207,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[902,849,923,725],"tags":[1174],"class_list":["post-228357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kod-3","category-pidruchnyky","category-inshyj","category-rozrobnyk","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/228357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/comments?post=228357"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/228357\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/224207"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=228357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=228357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=228357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}