GriddleGriddle / Griddle

Simple Grid Component written in React
http://griddlegriddle.github.io/Griddle/
MIT License
2.5k stars 378 forks source link

Props not Working #829

Open pedrosimao opened 6 years ago

pedrosimao commented 6 years ago

Griddle version

1.8.0

Expected Behavior

Settings Toggle and Filter to respond to Props settings

Actual Behavior

Nothing changes

Steps to reproduce

I am currently using Griddle like this: <Griddle data={this.fakeData} styleConfig={styleConfig} plugins={[plugins.LocalPlugin]} filterPlaceholderText={'search users'} showSettings={false} showFilter={false} enableToggleCustom={false} />

Settings Toggle buttons still appear on screen. The same goes for "Filter" input box. Also text inside filter input is still the default value and not 'search users'.

Am I facing a version difference problem?

dahlbyk commented 6 years ago

It looks like you're using a few Griddle v0 props?

showSettings={false}

Try enableSettings={false} (cc https://github.com/GriddleGriddle/Griddle/issues/816).

filterPlaceholderText={'search users'}

You can use textProperties={{ filterPlaceholder: 'search users' }} since v1.13.1, or to avoid an upgrade you can override Filter/FilterContainer with their changes from #780.

showFilter={false}

We don't currently have an equivalent prop for this. The easiest way to hide the filter is to swap in a component that renders nothing: components={{ Filter: () => null }}. We'd certainly accept a PR to make this more intuitive.

pedrosimao commented 6 years ago

Thanks a lot for your very fast answer! It all works now! Actually, it is not easy to find updated documentation. Any plans for that?

dahlbyk commented 6 years ago

http://griddlegriddle.github.io/Griddle/docs/ is incomplete, but it shouldn't be wrong. If it is, we would like to fix that.

The best documentation is honestly the Storybook. But we would be glad for any assistance in updating either to make the project easier to use.