What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-02 19:45:39
react hook example
// Hooks let you build stateful and dynamic components import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> ... Add solution -
Javascript 2022-02-02 09:21:03
expo image editor
import { ImageEditor } from "expo-image-editor"; function App() { const [imageUri, setImageUri] = useState(undefined); const [editorVisible, setEditorVisible] = useState(false); const selectPhoto = async () => { // Get the permis... Add solution -
Javascript 2022-01-31 13:15:46
fremer motion react library
const [selectedId, setSelectedId] = useState(null) <AnimateSharedLayout type="crossfade"> {items.map(item => ( <motion.div layoutId={item.id} onClick={() => setSelectedId(item.id)}> <motion.h5>{item.subtitle}<... Add solution -
Javascript 2022-01-30 17:56:08
audio in react
import React, { useState, useEffect } from "react"; const useAudio = url => { const [audio] = useState(new Audio(url)); const [playing, setPlaying] = useState(false); const toggle = () => setPlaying(!playing); useEffect(() =>... Add solution -
Javascript 2022-01-30 11:35:55
socket io react js
import React, { useState, useEffect } from "react"; import socketIOClient from "socket.io-client"; const ENDPOINT = "http://127.0.0.1:4001"; function App() { const [response, setResponse] = useState(""); useEf... Add solution