Closed wbern closed 4 years ago
Sandbox: https://codesandbox.io/s/preact-custom-element-forked-mro87
Try change the attribute value to something else.
attribute
You don't even need to render the string, just call size.toLowerCase() in an expression inside the functional component.
Do a check if the size prop is null, and do an early return. The temporary null value is what caused the element to be cloned.
With null checking sandbox: https://codesandbox.io/s/preact-custom-element-forked-40vfr?file=/src/Button.tsx
Just try to change the size attribute as usual.
Sandbox: https://codesandbox.io/s/preact-custom-element-forked-mro87
How to reproduce
Try change the
attribute
value to something else.You don't even need to render the string, just call size.toLowerCase() in an expression inside the functional component.
The issue
Workaround
Do a check if the size prop is null, and do an early return. The temporary null value is what caused the element to be cloned.
With null checking sandbox: https://codesandbox.io/s/preact-custom-element-forked-40vfr?file=/src/Button.tsx
Just try to change the size attribute as usual.