gregnb / gregnb/mui-datatables

Setting column display option to a string resets component state

Open
#566 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I am not 100% sure whether this is a bug with this project or I am doing something wrong with react hooks.

## Expected Behavior
Setting the column display property to a string should not reset state.

## Current Behavior
The component state is reset.

## Steps to Reproduce (for bugs)
https://codesandbox.io/s/mol243nzxj

Setting `display` to a string e.g. `"false"` instead of `false` will cause the state to be reset when changing the switch value.

1. Open the console window
2. Click a switch an observe that an array containing 4 objects is logged.
3. Change `display: true` to `display: "true"`.
4. Click a switch and observe that an empty array is logged and the table only contains one object.

## Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 3.9.3 |
| MUI-datatables | 2.0.0-beta.59 |
| React | 16.8.6 |
| browser | Chrome Version 73.0.3683.103 (Official Build) (64-bit) |

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.