As discussed in https://github.com/WordPress/gutenberg/pull/30270#issuecomment-819545802, there is currently a warning that is logged whenever navigating to a nested bottom sheet that relies upon a callback. It would appear passing a non-serializable callback to the nested bottom sheet via props is not the best approach when using react-navigation.
Step-by-step reproduction instructions
Launch WPiOS or WPAndroid block editor.
Add a Cover block.
Set an image as the media.
Open the Cover block settings.
Tap "Edit focal point" within the Media section.
Tap "Cancel."
Tap "Color" within the Overlay section.
Expected behaviour
No warnings are logged.
Actual behaviour
The following warnings are logged in the development server.
WARN Non-serializable values were found in the navigation state. Check:
FocalPoint > params.onFocalPointChange (Function)
This can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.
WARN Non-serializable values were found in the navigation state. Check:
Color > params.onColorChange (Function)
This can break usage such as persisting and restoring state. This might happen if you passed non-serializable values such as function, class instances etc. in params. If you need to use components with callbacks in your options, you can use 'navigation.setOptions' instead. See https://reactnavigation.org/docs/troubleshooting#i-get-the-warning-non-serializable-values-were-found-in-the-navigation-state for more details.
Description
As discussed in https://github.com/WordPress/gutenberg/pull/30270#issuecomment-819545802, there is currently a warning that is logged whenever navigating to a nested bottom sheet that relies upon a callback. It would appear passing a non-serializable callback to the nested bottom sheet via props is not the best approach when using
react-navigation
.Step-by-step reproduction instructions
Expected behaviour
No warnings are logged.
Actual behaviour
The following warnings are logged in the development server.
Screenshots or screen recording (optional)
n/a
WordPress information
Device information