Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Forked from pubsweet / pubsweet
2928 commits behind the upstream repository.
StateItem.md 529 B

An interactive element which upon click changes its text content. The available text values should be provided as an array of strings. The actual operation which takes place is a right shift on the array of provided values

const data = {
  values: ['To Clean', 'Cleaning', 'Cleaned'],
  index: 0,
  disabled: false,
  name: 'clean',
}

const update = value => {
  console.log('value', value)
}

;<StateItem
  values={data.values}
  disabled={data.disabled}
  update={update}
  index={data.index}
  name={data.name}
/>