mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-19 01:24:18 +00:00
* @uppy/react: propagate prop mutation Fixes: https://github.com/transloadit/uppy/issues/3203 * fixup! @uppy/react: propagate prop mutation * fixup! @uppy/react: propagate prop mutation * Apply changes to other Components * Update TODOs
10 lines
456 B
JavaScript
10 lines
456 B
JavaScript
'use strict'
|
|
|
|
// TODO: replace with `Object.hasOwn` when dropping support for older browsers.
|
|
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)
|
|
|
|
module.exports = function nonHtmlPropsHaveChanged (component, prevProps) {
|
|
return Object.keys(component.props)
|
|
// TODO: replace `validProps` with an exported `Symbol('htmlProps')`.
|
|
.some(key => !hasOwn(component.validProps, key) && component.props[key] !== prevProps[key])
|
|
}
|