@wordpress/element
Advanced tools
Comparing version 2.15.0 to 2.16.0
@@ -0,2 +1,37 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { AppRegistry } from 'react-native'; | ||
import { omit } from 'lodash'; | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { applyFilters, doAction } from '@wordpress/hooks'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { cloneElement } from './react'; | ||
var render = function render(element, id) { | ||
return AppRegistry.registerComponent(id, function () { | ||
return function (propsFromParent) { | ||
var parentProps = omit(propsFromParent || {}, ['rootTag']); | ||
doAction('native.pre-render', parentProps); | ||
var filteredProps = applyFilters('native.block_editor_props', parentProps); | ||
doAction('native.render', filteredProps); | ||
return cloneElement(element, filteredProps); | ||
}; | ||
}); | ||
}; | ||
/** | ||
* Render a given element on Native. | ||
* This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent` | ||
* | ||
* @param {WPElement} element Element to render. | ||
*/ | ||
export { render }; | ||
//# sourceMappingURL=react-platform.native.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.render = void 0; | ||
var _reactNative = require("react-native"); | ||
var _lodash = require("lodash"); | ||
var _hooks = require("@wordpress/hooks"); | ||
var _react = require("./react"); | ||
/** | ||
* External dependencies | ||
*/ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
var render = function render(element, id) { | ||
return _reactNative.AppRegistry.registerComponent(id, function () { | ||
return function (propsFromParent) { | ||
var parentProps = (0, _lodash.omit)(propsFromParent || {}, ['rootTag']); | ||
(0, _hooks.doAction)('native.pre-render', parentProps); | ||
var filteredProps = (0, _hooks.applyFilters)('native.block_editor_props', parentProps); | ||
(0, _hooks.doAction)('native.render', filteredProps); | ||
return (0, _react.cloneElement)(element, filteredProps); | ||
}; | ||
}); | ||
}; | ||
/** | ||
* Render a given element on Native. | ||
* This actually returns a componentProvider that can be registered with `AppRegistry.registerComponent` | ||
* | ||
* @param {WPElement} element Element to render. | ||
*/ | ||
exports.render = render; | ||
//# sourceMappingURL=react-platform.native.js.map |
{ | ||
"name": "@wordpress/element", | ||
"version": "2.15.0", | ||
"version": "2.16.0", | ||
"description": "Element React module for WordPress.", | ||
@@ -37,3 +37,3 @@ "author": "The WordPress Contributors", | ||
}, | ||
"gitHead": "8e06f0d212f89adba9099106497117819adefc5a" | ||
"gitHead": "381a42b62e157d0e7fd6366cc51b0f5725990044" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90
4820
437450