What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-11-21 13:33:07
refreshcontrol
import React from 'react'; import { RefreshControl, SafeAreaView, ScrollView, StyleSheet, Text } from 'react-native'; const wait = (timeout) => { return new Promise(resolve => setTimeout(resolve, timeout)); } const App = () => { const [refr... Add solution -
TypeScript 2021-11-21 07:10:14
react typescript custom hook
export function useLoading() { const [isLoading, setState] = React.useState(false); const load = (aPromise: Promise<any>) => { setState(true); return aPromise.finally(() => setState(false)); }; return [isLoading, load] as const... Add solution -
Javascript 2021-11-20 07:31:10
react hide element
React circa 2020 In the onClick callback, call the state hook's setter function to update the state and re-render: const Search = () => { const [showResults, setShowResults] = React.useState(false) const onClick = () => setShowResults(true) r... Add solution -
Other 2021-11-19 10:51:40
Dialog using Reach
function Example(props) { const [showDialog, setShowDialog] = React.useState(false); const open = () => setShowDialog(true); const close = () => setShowDialog(false); return ( <div> <button onClick={open}>Open Dialog</but... Add solution -
Javascript 2021-11-14 17:55:12
Switch React Native Paper
import { Switch } from 'react-native-paper'; const MyComponent = () => { const [isSwitchOn, setIsSwitchOn] = React.useState(false); const onToggleSwitch = () => setIsSwitchOn(!isSwitchOn); return <Switch value={isSwitchOn} onValueChange=... Add solution -
Javascript 2021-11-04 11:14:06
next js modal dialog
import React from "react"; // reactstrap components import { Button, Modal, ModalBody, ModalFooter } from "reactstrap"; function Example() { const [modalOpen, setModalOpen] = React.useState(false); return ( <> <... Add solution -
Javascript 2021-08-29 09:26:02
semantic ui react modal
import React from 'react' import { Button, Header, Image, Modal } from 'semantic-ui-react' function ModalExampleModal() { const [open, setOpen] = React.useState(false) return ( <Modal onClose={() => setOpen(false)} onOpen={() =... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5