Remove props from component when AutoProps change prop to undefined
Closed this issue · 1 comments
allyssonsantos commented
In some cases it's important to remove props from the rendered component on preview panel.
Example:
- On first render component have checked value equals
undefined
, so, its anuncontrolled
component; - When checked is defined, the component on preview panel and on the code example receive
true
as a value, and, the component is nowcontrolled
; - When checked prop is removed the component on preview panel receive
false
but on code example panel the props isundefined
, because its not present on code example, in this case, the component must receiveundefined
to be uncontrolled again.
So, we need to remove props (set as undefined) from the rendered component on preview panel.