profile
viewpoint

Ask questionsBug: When a cloneElement conditionally switches components, the onTouchMove is invalid

React version: 17.0.2

<div
    ref={rootRef}
    className="rate"
    onTouchMove={onTouchMove}
>
    {
        cloneElement(full ? fullIcon : voidIcon, {
            className: classNames("rate__icon", {
                "rate__icon--full": full,
            }),
        })
    }
</div>

Codesandbox:https://codesandbox.io/s/quiet-meadow-rfq1m

The current behavior

When a cloneElement conditionally switches components, the onTouchMove is invalid

The expected behavior

When a cloneElement conditionally switches components, the onTouchMove should work

facebook/react

Answer questions eps1lon

Duplicate of https://github.com/facebook/react/issues/1355

useful!
source:https://uonfu.com/
answerer
Sebastian Silbermann eps1lon Dresden, Germany https://solverfox.dev Programmer. I care about accessibility and testing.
Github User Rank List