@uppy/react
Advanced tools
Comparing version 3.0.0-beta.3 to 3.0.0-beta.4
# @uppy/react | ||
## 3.0.0-beta.4 | ||
Released: 2022-08-16 | ||
Included in: Uppy v3.0.0-beta.5 | ||
- @uppy/core,@uppy/react: Fix all breaking todo comments for 3.0 (Merlijn Vos / #3907) | ||
## 3.0.0-beta.2 | ||
@@ -4,0 +11,0 @@ |
@@ -21,3 +21,3 @@ import { createElement as h, Component } from 'react'; | ||
this.installPlugin(); | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, | ||
@@ -61,4 +61,2 @@ target: this.container | ||
render() { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props); | ||
return h('div', { | ||
@@ -69,3 +67,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps | ||
...getHTMLProps(this.props) | ||
}); | ||
@@ -72,0 +70,0 @@ } |
@@ -27,3 +27,3 @@ import { createElement as h, Component } from 'react'; | ||
this.installPlugin(); | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, | ||
@@ -154,4 +154,2 @@ onRequestCloseModal: onRequestClose | ||
render() { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props); | ||
return h('div', { | ||
@@ -162,3 +160,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps | ||
...getHTMLProps(this.props) | ||
}); | ||
@@ -165,0 +163,0 @@ } |
@@ -22,3 +22,3 @@ import { createElement as h, Component } from 'react'; | ||
this.installPlugin(); | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, | ||
@@ -71,4 +71,2 @@ target: this.container | ||
render() { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props); | ||
return h('div', { | ||
@@ -79,3 +77,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps | ||
...getHTMLProps(this.props) | ||
}); | ||
@@ -82,0 +80,0 @@ } |
@@ -1,8 +0,5 @@ | ||
'use strict'; // TODO: replace with `Object.hasOwn` when dropping support for older browsers. | ||
'use strict'; | ||
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key); | ||
export default 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]); | ||
export default function nonHtmlPropsHaveChanged(props, prevProps) { | ||
return Object.keys(props).some(key => !Object.hasOwn(props, key) && props[key] !== prevProps[key]); | ||
} |
@@ -21,3 +21,3 @@ import { createElement as h, Component } from 'react'; | ||
this.installPlugin(); | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, | ||
@@ -64,4 +64,2 @@ target: this.container | ||
render() { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props); | ||
return h('div', { | ||
@@ -72,3 +70,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps | ||
...getHTMLProps(this.props) | ||
}); | ||
@@ -75,0 +73,0 @@ } |
@@ -22,3 +22,3 @@ import { createElement as h, Component } from 'react'; | ||
this.installPlugin(); | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, | ||
@@ -75,4 +75,2 @@ target: this.container | ||
render() { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props); | ||
return h('div', { | ||
@@ -83,3 +81,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps | ||
...getHTMLProps(this.props) | ||
}); | ||
@@ -86,0 +84,0 @@ } |
{ | ||
"name": "@uppy/react", | ||
"description": "React component wrappers around Uppy's official UI plugins.", | ||
"version": "3.0.0-beta.3", | ||
"version": "3.0.0-beta.4", | ||
"license": "MIT", | ||
@@ -25,8 +25,8 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/dashboard": "^3.0.0-beta.3", | ||
"@uppy/drag-drop": "^3.0.0-beta.1", | ||
"@uppy/file-input": "^3.0.0-beta.1", | ||
"@uppy/progress-bar": "^3.0.0-beta.1", | ||
"@uppy/status-bar": "^3.0.0-beta.2", | ||
"@uppy/utils": "^5.0.0-beta", | ||
"@uppy/dashboard": "^3.0.0-beta.4", | ||
"@uppy/drag-drop": "^3.0.0-beta.2", | ||
"@uppy/file-input": "^3.0.0-beta.2", | ||
"@uppy/progress-bar": "^3.0.0-beta.2", | ||
"@uppy/status-bar": "^3.0.0-beta.3", | ||
"@uppy/utils": "^5.0.0-beta.1", | ||
"prop-types": "^15.6.1" | ||
@@ -39,6 +39,5 @@ }, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.0.0-beta.3", | ||
"@uppy/core": "^3.0.0-beta.4", | ||
"react": "^16.0.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
"stableVersion": "2.2.1" | ||
} | ||
} |
@@ -22,3 +22,3 @@ import { createElement as h, Component } from 'react' | ||
this.installPlugin() | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, target: this.container } | ||
@@ -54,4 +54,2 @@ delete options.uppy | ||
render () { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props) | ||
return h('div', { | ||
@@ -62,3 +60,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps, | ||
...getHTMLProps(this.props), | ||
}) | ||
@@ -65,0 +63,0 @@ } |
@@ -23,3 +23,3 @@ import { createElement as h, Component } from 'react' | ||
this.installPlugin() | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, onRequestCloseModal: onRequestClose } | ||
@@ -139,4 +139,2 @@ delete options.uppy | ||
render () { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props) | ||
return h('div', { | ||
@@ -147,3 +145,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps, | ||
...getHTMLProps(this.props), | ||
}) | ||
@@ -150,0 +148,0 @@ } |
@@ -23,3 +23,3 @@ import { createElement as h, Component } from 'react' | ||
this.installPlugin() | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, target: this.container } | ||
@@ -67,4 +67,2 @@ delete options.uppy | ||
render () { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props) | ||
return h('div', { | ||
@@ -75,3 +73,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps, | ||
...getHTMLProps(this.props), | ||
}) | ||
@@ -78,0 +76,0 @@ } |
'use strict' | ||
// TODO: replace with `Object.hasOwn` when dropping support for older browsers. | ||
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) | ||
export default 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]) | ||
export default function nonHtmlPropsHaveChanged (props, prevProps) { | ||
return Object.keys(props).some(key => !Object.hasOwn(props, key) && props[key] !== prevProps[key]) | ||
} |
@@ -22,3 +22,3 @@ import { createElement as h, Component } from 'react' | ||
this.installPlugin() | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, target: this.container } | ||
@@ -56,4 +56,2 @@ delete options.uppy | ||
render () { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props) | ||
return h('div', { | ||
@@ -64,3 +62,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps, | ||
...getHTMLProps(this.props), | ||
}) | ||
@@ -67,0 +65,0 @@ } |
@@ -23,3 +23,3 @@ import { createElement as h, Component } from 'react' | ||
this.installPlugin() | ||
} else if (nonHtmlPropsHaveChanged(this, prevProps)) { | ||
} else if (nonHtmlPropsHaveChanged(this.props, prevProps)) { | ||
const options = { ...this.props, target: this.container } | ||
@@ -71,4 +71,2 @@ delete options.uppy | ||
render () { | ||
// TODO: stop exposing `validProps` as a public property and rename it to `htmlProps` | ||
this.validProps = getHTMLProps(this.props) | ||
return h('div', { | ||
@@ -79,3 +77,3 @@ className: 'uppy-Container', | ||
}, | ||
...this.validProps, | ||
...getHTMLProps(this.props), | ||
}) | ||
@@ -82,0 +80,0 @@ } |
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
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
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
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
113659
1872