Conversation
There was a problem hiding this comment.
Pull request overview
Updates the v3 hooks config filtering so Pan offset props that may temporarily exist on the JS config object (especially when explicitly set to undefined) don’t trigger “invalid property” warnings during native config preparation.
Changes:
- Add
Panoffset props (activeOffsetX/Y,failOffsetX/Y) toPropsToFilterto suppress warnings when they appear in the config object prior to remapping/deletion.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Pan offset props before remapping: | ||
| 'activeOffsetY', | ||
| 'failOffsetX', | ||
| 'failOffsetY', | ||
| 'activeOffsetX', |
There was a problem hiding this comment.
or deleting these keys in transformOffsetProp even when the value is undefined
This is what I said in note in the description of the PR. I'm not sure if we want to do this, but it is an option (cc @j-piasecki)
There was a problem hiding this comment.
Does passing undefined currently reset the value to the default?
There was a problem hiding this comment.
When you pass undefined it is treated as if it wasn't passed at all.
There was a problem hiding this comment.
Or do you mean alternating between some value and undefined?
There was a problem hiding this comment.
Or do you mean alternating between some value and undefined?
Yes
Description
In
Pangesture, offset properties are handled differently than other props. Before they're sent to native side, they are mapped to separatestartandendoffset properties. This happens when offset props are present. However, if one explicitly sets value of offset property toundefined, e.g.:the following warning can be observed:
This PR adds offset properties to our filter. With this change, warning no longer appears.
Fixes #4021
Note
It could also be solved by dynamically deleting
undefinedfields from config, but simply ignoring them sounds safer.Test plan
Tested on the following code: