[FIX] component: props values are own property of props object

This commit is contained in:
Géry Debongnie
2022-06-03 16:39:16 +02:00
committed by aab-odoo
parent c7bd0ab85c
commit 5d5a530505
3 changed files with 57 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ export function useComponent(): Component {
* Apply default props (only top level).
*/
function applyDefaultProps<P extends object>(props: P, defaultProps: Partial<P>): P {
const result = Object.create(props);
const result = Object.assign({} as any, props);
for (let propName in defaultProps) {
if (props[propName] === undefined) {
result[propName] = defaultProps[propName];