Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List not re-rendering after state/props change #3

Open
davidsharp opened this issue Aug 13, 2018 · 0 comments
Open

List not re-rendering after state/props change #3

davidsharp opened this issue Aug 13, 2018 · 0 comments

Comments

@davidsharp
Copy link

davidsharp commented Aug 13, 2018

I've been attempting to get some pagination within a long list like so:

<Select onSelect={item => this.setState({message: item + ' was selected'})}>
  {
    this.state.pages[this.state.page].map( o => <Option value={o.domain}
      onSelect={() => opn(o.domain, { wait: false }).then(x=>process.exit())}
    >
      {o.domain}
    </Option> )
  }
  <Option value={'prev'}
    onSelect={() => this.setState({page:this.state.page-1})}
  >
    prev page
  </Option>
  <Option value={'next'}
    onSelect={() => this.setState({page:this.state.page+1})}
  >
    next page
  </Option>
</Select>

I can see that the state for the page number changes, but not the list itself. I've also attempted to strictly use props to change this, rather than state, but to no avail.

I'm not sure if it's specifically ink-select components or ink itself that's causing this, but I'd like to be able to paginate my lists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant