How do I remove the component border shown onClick in react?

Viewed 8052
2 Answers

This is caused by the &focus css selector as shown bij the inspector.

enter image description here

Add outline: none to the <button> to remove it;

<button style={{outline: 'none'}} onClick={onInputSubmit}>

This is because the :focus pseudo-class is adding an outline into the button. You can change that behaviour by using css like this:

button:focus {
  outline: none;
}

Or by adding it as an inline style as well, even though I personally don't recommend it because having a lot of inline styles could cause to have a messy and hard to read HTML.

Related