CustomRowComponent does NOT get handed state
See original GitHub issueGriddle version
1.5 and 1.3 (works in 1.0.3)
Expected Behavior
Customize row to make it look like a list. The rowDataSelector is not getting handed the state objects (I think). Follow the code here in the documentation: https://github.com/GriddleGriddle/griddle-docs/blob/master/components/GriddleList.js
Actual Behavior
const CustomRowComponent = connect((state, props) => ({
rowData: plugins.LocalPlugin.selectors.rowDataSelector(state, props),
}))(({ rowData }) => (
<HotelDetail
hotel={rowData}
selectHotel={this.selectHotelList}
favoriteHotel={this.favHotel}
/>
));
…
<Griddle
data={this.props.hotels}
pageProperties={{
pageSize: 60,
}}
plugins={[plugins.LocalPlugin]}
sortProperties={sortProperties}
components={{
Row: CustomRowComponent,
TableContainer: CustomTableComponent,
TableBody: CustomTableBody,
SettingsToggle: () => <span />,
}}
/>
TypeError: state.get is not a function at Object.rowDataSelector (dataSelectors.js:289) at Function.mapToProps (HotelList.js:28) at mapToPropsProxy (wrapMapToProps.js:43) at Function.detectFactoryAndVerify (wrapMapToProps.js:52) at mapToPropsProxy (wrapMapToProps.js:43) at handleFirstCall (selectorFactory.js:26) at pureFinalPropsSelector (selectorFactory.js:74) at Object.runComponentSelector [as run] (connectAdvanced.js:26) at Connect.initSelector (connectAdvanced.js:178) at new Connect (connectAdvanced.js:119)
Steps to reproduce
Run the example in the Documentation https://github.com/GriddleGriddle/griddle-docs/blob/master/components/GriddleList.js
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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
I had to downgrade to 1.0.3 to get this work again. Looks like it is broken in 1.3 and 1.5 (atleast for my use case.)
If anyone gets there first, though, that’s cool 😃