GriddleGriddle / Griddle

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

Improve Prop Change/State Update #784

Closed dahlbyk closed 6 years ago

dahlbyk commented 6 years ago

Griddle major version

1.11

Changes proposed in this pull request

Fixes #781 root cause (cc @sum32)

  1. Includes first commit from #783.
  2. Added tests for GRIDDLE_UPDATE_STATE and adjusted its behavior a bit (e.g. not losing data).
  3. Updated actions.updateState to pass all state through, instead of only data, pageProperties and sortProperties. That limitation was introduced by @joellanciaux way back in #505, but it's not obvious why.
  4. Added a story with a minimal repro (changing a <Griddle /> prop), which I ultimately expanded to demonstrate changing several <Griddle /> props, including data and styleConfig.

Why these changes are made

Changes to props should be reflected in Griddle's store and its rendering.

Are there tests?

Tests and stories!

ryanlanciaux commented 6 years ago

Verified (smoke test on some of my bigger projects) and published!

image