You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current implementation of the WhenVisible component, it is not possible to use both data and params props simultaneously. The issue lies in the getReloadParams function, which either returns data or params but not both. To provide a more flexible and user-friendly API, it would be ideal to merge the data prop into params when both are provided.
Steps to reproduce:
Use the WhenVisible component with both data and params props.
The getReloadParams function will only consider data and ignore params.
Versions:
@inertiajs/react
version: v2-betaDescribe the problem:
In the current implementation of the
WhenVisible
component, it is not possible to use both data andparams
props simultaneously. The issue lies in thegetReloadParams
function, which either returns data or params but not both. To provide a more flexible and user-friendly API, it would be ideal to merge the data prop into params when both are provided.Steps to reproduce:
Actual code
inertia/packages/react/src/WhenVisible.ts
Line 24 in 88a765b
Expected behavior:
When both data and params are provided, the function should merge them into a single object, allowing both to work together.
A initial implementation for React can be something like:
The text was updated successfully, but these errors were encountered: