Returning
null
will not update state and trigger a component re-render
Example:
updateMocktail = mocktail => { const newMocktail = mocktail; this.setState(state => { if (state.mocktail === newMocktail) { return null; } else { return { mocktail }; } }) }