@chakra-ui/react APIs
- Button
- Box
- ChakraProvider
- Text
- Flex
- Input
- Stack
- useDisclosure
- ModalOverlay
- ModalContent
- ModalBody
- Image
- Modal
- ModalCloseButton
- Heading
- IconButton
- ModalHeader
- extendTheme
- HStack
- Link
- Divider
- Tooltip
- SimpleGrid
- Spinner
- ModalFooter
- Center
- Table
- FormControl
- FormLabel
- useToast
- useColorMode
- InputGroup
- VStack
- Icon
- Select
- Menu
- MenuButton
- MenuList
- MenuItem
- Badge
- ListItem
- Thead
- Tr
- Th
- Tbody
- Td
- Container
- Alert
- useColorModeValue
- Spacer
- Tabs
- TabList
- Tab
- TabPanels
- TabPanel
- Skeleton
- Tag
- Avatar
- Textarea
- SkeletonText
- InputLeftElement
- Grid
- DrawerBody
- DrawerContent
- DrawerCloseButton
- DrawerHeader
- DrawerOverlay
- AspectRatio
- theme
- SkeletonCircle
- UnorderedList
- Code
- ButtonGroup
- PopoverTrigger
- Popover
- PopoverContent
- PopoverBody
- CSSReset
- Drawer
- DrawerFooter
- List
- FormHelperText
- InputRightElement
- Collapse
- AlertIcon
- Switch
- Stat
- StatLabel
- StatNumber
- ColorModeScript
- useClipboard
- Checkbox
- LinkBox
- LinkOverlay
- PopoverArrow
- PopoverHeader
- useTheme
- InputRightAddon
- keyframes
- useBreakpointValue
- StackDivider
- SliderTrack
- SliderFilledTrack
- SliderThumb
- Radio
- RadioGroup
- StatGroup
- OrderedList
- MenuDivider
- FormErrorMessage
- CloseButton
- useMediaQuery
- AlertTitle
- AlertDescription
- Accordion
- AccordionItem
- AccordionButton
- AccordionIcon
- AccordionPanel
- PopoverCloseButton
- GridItem
- ThemeProvider
- Progress
- useRadio
- useRadioGroup
- useBreakpoint
- Slider
- CircularProgress
- ColorModeProvider
- cookieStorageManager
- localStorageManager
- useBoolean
- AlertDialog
- AlertDialogBody
- AlertDialogCloseButton
- AlertDialogContent
- AlertDialogFooter
- AlertDialogHeader
- AlertDialogOverlay
- NumberInputField
- NumberInput
- useTab
- FormErrorIcon
- VisuallyHiddenInput
- Portal
- useToken
- useInterval
- VisuallyHidden
- Wrap
- WrapItem
- createIcon
- PopoverFooter
- AvatarBadge
- chakra
- forwardRef
- TableCaption
- Breadcrumb
- Kbd
- createStandaloneToast
OtherRelated APIs
@chakra-ui/react#forwardRef JavaScript Examples
The following examples show how to use
@chakra-ui/react#forwardRef.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignatureSignUp.jsx From scaffold-directory with MIT License | 5 votes |
SignatureSignUp = forwardRef(({ address, userProvider, onSuccess, setUserRole }, ref) => {
const [loading, setLoading] = useState(false);
const toast = useToast({ position: "top", isClosable: true });
const handleLoginSigning = async () => {
setLoading(true);
let signMessage;
try {
const signMessageResponse = await axios.get(`${serverUrl}/sign-message`, {
params: {
messageId: "login",
address,
},
});
signMessage = signMessageResponse.data;
console.log("signMessage", signMessage);
} catch (e) {
// TODO handle errors. Issue #25 https://github.com/moonshotcollective/scaffold-directory/issues/25
toast({
description: " Sorry, the server is overloaded. ???",
status: "error",
});
setLoading(false);
console.log(e);
return;
}
if (!signMessage) {
toast({
description: " Sorry, the server is overloaded. ???",
status: "error",
});
setLoading(false);
return;
}
let signature;
try {
signature = await userProvider.send("personal_sign", [signMessage, address]);
} catch (err) {
toast({
description: "Couldn't get a signature from the Wallet",
status: "error",
});
setLoading(false);
return;
}
console.log("signature", signature);
const res = await axios.post(`${serverUrl}/sign`, {
address,
signature,
});
setLoading(false);
if (res.data) {
onSuccess();
setUserRole(USER_ROLES[res.data.role] ?? USER_ROLES.registered);
}
};
return (
<Button ref={ref} colorScheme="blue" disabled={loading} onClick={handleLoginSigning}>
<span role="img" aria-label="write icon">✍</span><chakra.span ml={2}>Register</chakra.span>
</Button>
);
})