@carbonare/submission
v0.2.6
Published
Reused submitting button component build with Carbon Design System
Downloads
19
Readme
@carbonare/submission
Before using you have to add "yarn add carbon-components-react" from IBM
yarn add @carbonare/submission
Usage
import { SubmissionButton, useSubmission } from "@carbonare/submission"
// Component
const Component = () => {
let { success, description, setSubmission } = useSubmission("Some text");
return (
<>
<SubmissionButton
success={success}
loading={loading}
title={"Some title"}
description={description}
kind={primary}
/>
</>
)
}
// Mutation or Query Apollo GraphQl
let [someMutation, { loading, data, error }] = useMutation(MUTATION, {
onCompleted(data) {
setSubmission("Some text");
}
});