Issue with Dataset Filtering and React Error #422

I am encountering a serious issue related to dataset filtering on my site.

When I apply a dataset filter inside a handler like $w(“#dataset”).onReady(), there is a noticeable delay before the filter takes effect. However, if I remove the handler and apply the filter directly during page loading (inside $w.onReady()), the filter works immediately — but then I encounter the following error: Minified React error #422.

I have already tried using async/await properly to manage the process, but the issue persists.

Could you please advise on the best practice to apply a dataset filter immediately on page load without causing this React error or experiencing a filter delay?