-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable: Filter Menu not displayed when inside <React.StrictMode> in React 18 #2777
Comments
I updated your code sandbox reproducer to better show the issue: https://codesandbox.io/s/primereact-test-forked-vkirpl?file=/src/index.js Does NOT Work: ReactDOM.createRoot(document.getElementById("root3")).render(
// remove StricMode and the app works fine
<React.StrictMode>
<App />
</React.StrictMode>
); Works: ReactDOM.createRoot(document.getElementById("root3")).render(
<App />
); |
Found this: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-strict-mode Look like Strict Mode is way different in React 18 it must be causing this issue |
Just wanted to add that using filterDisplay={'row'} also is failing in with React 18 (in StrictMode). It fails with this error: TypeError I forked the sandbox here: https://codesandbox.io/s/primereact-test-forked-5nx688?file=/src/index.js |
I also have this error in my project, thank you! |
…gering filter ###Defect Fixes Fix primefaces#2777: Check if `globalFilter` is not null because triggering filter Check if `globalFilter` is not null because triggering filter in React 18 StrictMode when double-invoking effects (mount -> unmount -> mount)
Hi @melloware, submitted a PR for this issue. Fix both this issue and #2947 |
Excellent thank you for the PR! |
In case it helps you with the adoption of React 18,
I'm submitting a...
Codesandbox Case
https://codesandbox.io/s/primereact-test-forked-vkirpl?file=/src/index.js
Current behavior
When opening the filter menu, only the "Clear" and "Apply" buttons appear.
Expected behavior
The actual filters should be shown too.
Does NOT Work:
Works:
The text was updated successfully, but these errors were encountered: