Skip to content

Instantly share code, notes, and snippets.

@danielsnider
Created February 15, 2019 19:57
Show Gist options
  • Save danielsnider/47f6a9c45d7301f10d8ac1098f8047c4 to your computer and use it in GitHub Desktop.
Save danielsnider/47f6a9c45d7301f10d8ac1098f8047c4 to your computer and use it in GitHub Desktop.

Button in card

<button
  type="button"
  class="btn btn-dark"
  style={{ marginLeft: "100px" }}
  onClick={e => AddToCollection(e, res)}
>
  <i className="fa fa-plus" />{" "}
</button>

Function to add to collection

function AddToCollection(e, res) {
  console.log(e);
  console.log(res);
  e.preventDefault();
  // CALL API
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment