Check out example codes for "bootstrap buttons Toggle states". It will help you in understanding the concepts better.

Code Example 1

Add data-toggle="button" to toggle a button’s active state. If you’re 
pre-toggling a button, you must manually add the .active class and
aria-pressed="true" to the <button>.

<button type="button" class="btn btn-primary" data-toggle="button" aria-pressed="false">
  Single toggle

Learn ReactJs, React Native from