inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.55k stars 435 forks source link

params in WhenVisible are not working at all #2064

Closed HichemTab-tech closed 1 month ago

HichemTab-tech commented 1 month ago

Version:

Describe the problem:

the params attribute is not having any effect on the component WhenVisible.

Steps to reproduce:

I tried to use the params to pass the cusrsor of pagination in infinite scrolling page, but the params are not working at all

<WhenVisible
        always
        fallback={(
            <SpinnerWithRetry/>
        )}
        data='rooms'
        params={{
            data: {
                lastRoomId: rooms.data[rooms.data.length - 1].id
            },
            onBefore: async (data) => {
                console.log("onBefore", data);
            }
        }}
        children={null}/>
PedroAugustoRamalhoDuarte commented 1 month ago

Hello @HichemTab-tech good catch, maybe is duplicated from https://github.com/inertiajs/inertia/issues/2025, i have made a PR to fix this one too

HichemTab-tech commented 1 month ago

Oh yes @PedroAugustoRamalhoDuarte Thanks for the PR, we really need that.