-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Bug in @preact/signals v2.0.1 and v1.3.2 breaking material-react-table and @material-table/core functionality #650
Comments
What preact version are you using? The issue stems from #630 however when you are using hooks in any Preact older than 10.12.0 this issue should not be present. I can't currently really dig through that codebase as it's a bit unwieldly in the amount of dependencies it uses to achieve a table 😅 that being said, when hooks settle on the same value we bail https://github.com/preactjs/preact/blob/main/hooks/src/index.js#L252-L253, when there are no hooks we'll defer to the previous implementation of shouldComponentUpdate which is the signals one, the signals one will update for components that aren't using state and for components that are using signals and have pending updates. Tried your repository in https://stackblitz.com/edit/vitejs-vite-ugzcpmhw?file=src%2Fapp.tsx,src%2FTable.tsx,src%2Fmain.tsx,src%2Findex.css&terminal=dev and it works perfectly |
Hey, When I first encountered this issue, I was using One thing I noticed is that your setup on Would be great to know if there are any known differences in how Webpack vs. Vite handles this scenario. Thanks for your time. |
The bundler should really not affect module behavior that would be a serious infraction on their responsibilities. I'd encourage you to check whether you really are on the latest Preact version |
I have confirmed that I am using |
That's true, I would assume your webpack config has some odd configuration that mangles some property names or other. Normally however a bundler would not touch lib code, that being said, I can't really help you with that 😅 Even entertaining the base assumption here that webpack would mangle cross-library properties makes me feel like signals in general would not work. This all feels a bit like a long shot, I would see what these babel-plugins you are leveraging are doing. |
current:
2.0.1
Environment
@preact/signals-core
@preact/signals
@preact/signals-react
Describe the bug
There is a bug introduced in versions
@preact/signals
2.0.1 and 1.3.2, where certain table functionalities in popular libraries likematerial-react-table
and@material-table/core
stop working correctly. Specifically:material-react-table
(v3.1.0), the search bar doesn't open when clicked, and core features like sorting, filtering, and grouping fail to function.@material-table/core
(v6.4.4), thedetailPanel
feature, which expands table rows to show additional details, also breaks.The bug is triggered when importing the functions
computed
orsignal
from@preact/signals
, even if they are not actively used in the code. For example, the following import statement causes the issue:To Reproduce
Please refer to my GitHub repository for a project demonstrating the issue:
GitHub Repository for Reproducing the Bug
Although the issue affects both libraries, my GitHub repository demonstrates the issue specifically with
material-react-table
.Issue with
material-react-table
(Multiple Issues):Steps to reproduce the behavior:
computed
orsignal
from@preact/signals
:MaterialReactTable
component in your project.Issue with
@material-table/core
(Single Issue):Steps to reproduce the behavior:
computed
orsignal
from@preact/signals
:MaterialTable
component in your project.detailPanel
feature.detailPanel
feature does not expand the row to show additional details.Expected behavior
When importing
@preact/signals
, table functionalities like search bars, sorting, filtering, anddetailPanel
should continue to work as expected, without any interruptions or malfunctions.The text was updated successfully, but these errors were encountered: