Description
- Check if updating to the latest version resolves the issue
current:2.0.1
Environment
- I am using
@preact/signals-core
- I am using
@preact/signals
- I am using
@preact/signals-react
- I understand usage changed in v2, and I've followed the React Integration instructions
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 like material-react-table
and @material-table/core
stop working correctly. Specifically:
- In
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. - In
@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
or signal
from @preact/signals
, even if they are not actively used in the code. For example, the following import statement causes the issue:
import { computed, signal } from "@preact/signals";
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:
- Import
computed
orsignal
from@preact/signals
:
import { computed, signal } from "@preact/signals";
- Implement the
MaterialReactTable
component in your project.
import { MaterialReactTable } from "material-react-table";
const Table = () => (
<MaterialReactTable
columns={[
{
accessorKey: "firstName",
header: "First Name",
},
{
accessorKey: "lastName",
header: "Last Name",
},
]}
data={[
{
firstName: "John",
lastName: "Doe",
},
{
firstName: "Kevin",
lastName: "Vandy",
},
]}
/>
);
export default Table;
- Try using the search bar or the built-in features like filtering, sorting, grouping, etc.
- Issue: Clicking on the search bar does not open it, and other built-in features like filtering, sorting, and grouping do not work properly.
Issue with @material-table/core
(Single Issue):
Steps to reproduce the behavior:
- Import
computed
orsignal
from@preact/signals
:
import { computed, signal } from "@preact/signals";
- Implement the
MaterialTable
component in your project.
import MaterialTable from "@material-table/core";
const Table = () => (
<MaterialTable
columns={[
{
field: "firstName",
title: "First Name",
},
{
field: "lastName",
title: "Last Name",
},
]}
data={[
{
firstName: "John",
lastName: "Doe",
email: "john@doe.com",
},
{
firstName: "Kevin",
lastName: "Vandy",
email: "kevin@vandy.com",
},
]}
detailPanel={({ rowData }) => <div>{rowData.email}</div>}
/>
);
export default Table;
- Try using the
detailPanel
feature. - Issue: The
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.