question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CustomRowComponent does NOT get handed state

See original GitHub issue

Griddle 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:open
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sww314commented, Jun 12, 2017

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.)

0reactions
ryanlanciauxcommented, Jun 15, 2017

If anyone gets there first, though, that’s cool 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Row and Cells are re-rendering for all state changes, not just ...
Rows and Cell get re-rendered for all state changes. bug: Setting the state with unrelated changes causes re-rendering rows and cells.
Read more >
The useState set method is not reflecting a change immediately
Component or React.PureComponent , the state update using the updater provided by useState hook is also asynchronous, and will not be reflected immediately....
Read more >
React Table: A complete tutorial with examples
In this React table tutorial, we'll show you how to implemenet your own data table in React using react-table, complete with examples.
Read more >
How To Style React Components | DigitalOcean
In this tutorial, you'll learn three different ways to style React components: plain Cascading Style Sheets (CSS), inline styles with ...
Read more >
Creating a Custom Layout Manager
Note: This lesson covers writing layout code by hand, which can be challenging. If you are not interested in learning all the details...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found