Closed tangollama closed 5 years ago
From @swachs
The Button call in the second StackItem here doesn’t seem to do anything different from the first one (a direct call to this.openEntity()). openEntity() doesn’t make use of any passed in parameters.
<NerdletStateContext.Consumer> ... } else if (nerdletUrlState && nerdletUrlState.entityGuid) { ... <StackItem> <Button onClick={() => { this.openEntity(nerdletUrlState.entityGuid) }}>Open {nerdletUrlState.appName}</Button> </StackItem> ... </NerdletStateContext.Consumer>
You can rewrite this as follows, and get the same result:
<StackItem> <Button onClick={this.openEntity}>Open {nerdletUrlState.appName}</Button> </StackItem>
From @swachs
The Button call in the second StackItem here doesn’t seem to do anything different from the first one (a direct call to this.openEntity()). openEntity() doesn’t make use of any passed in parameters.
You can rewrite this as follows, and get the same result: