Skip to content

Can I re-render a notification? #63

Open
@mo-ib

Description

@mo-ib

I LOVE this library, very elegant. I want to use it beyond it's intended purpose as well, to display some bulk edit elements as I select them from a list. Is there a way to re-render the message prop so as I add elements, the message bosy updates? I'm trying something like this:

toggleRowsWithBulkEdit(item) {
  const rowsWithBulkEdit = toggleBulkEditItem(this.state.rowsWithBulkEdit, item)

  this.setState({rowsWithBulkEdit})

  const makeMessage = bulkEditProps => {
    console.log(bulkEditProps)
    return (
      <BulkEdit {...bulkEditProps}/>
    )
  }

  this.props.showNotification({
    title: 'hi',
    message: makeMessage({
      rowsWithBulkEdit,
    }),
    autoDismiss: 0,
    position: 'br',
    uid: 'bulkEditing',
  }, 'info')
}

and the console.log inside makeMessage is displaying the proper list, but obviously if I console log inside the BulkEdit component, it remains at 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions