GriddleGriddle / Griddle

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

Incorrect docs example for custom filter component #844

Open joshdcuneo opened 5 years ago

joshdcuneo commented 5 years ago

Griddle version

1.13.1

Expected Behavior

Custom filter component is passed onChange props to set filter as described in this example.

Actual Behavior

Custom filter component is passed setFilter props instead.

Steps to reproduce

Implement this example code using Griddle 1.13.1

class Filter extends Component {
  onChange(e) {
    this.props.onChange(e.target.value);
  }

  render() {
    return (
      <select onChange={this.onChange}>
        <option value="">All</option>
        <option value="Michigan">Michigan</option>
        <option value="Ohio">Ohio</option>
        <option value="Indiana">Indiana</option>
      </select>
    );
  }
}
...
<Griddle
  ...
  components={{
    Filter
  }}
/>

Pull request with failing test or storybook story with issue

While this step is not necessary, a failing test(s) and/or a storybook story will help us resolve the issue much more easily. Please see the README for more information.

Happy to submit a pull request if you can point me in the direction of the docs site repo.

ryanlanciaux commented 5 years ago

Happy to submit a pull request if you can point me in the direction of the docs site repo.

That would be excellent! The docs repo is available here https://github.com/GriddleGriddle/griddle-docs