What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-13 17:32:03
popup model in tailwind css
/* This example requires Tailwind CSS v2.0+ */ import { Fragment, useRef, useState } from 'react' import { Dialog, Transition } from '@headlessui/react' import { ExclamationIcon } from '@heroicons/react/outline' export default function Example() { cons... Add solution -
Javascript 2021-10-03 20:32:07
useref in functional component
/* A common use case is to access a child imperatively: */ function TextInputWithFocusButton() { const inputEl = useRef(null); const onButtonClick = () => { // `current` points to the mounted text input element inputEl.current.focus(); ... Add solution -
Javascript 2021-10-01 15:13:08
what does useref do react
/* A common use case is to access a child imperatively: */ function TextInputWithFocusButton() { const inputEl = useRef(null); const onButtonClick = () => { // `current` points to the mounted text input element inputEl.current.focus(); ... Add solution -
Javascript 2021-09-25 11:00:03
usePrevious
import { useState, useEffect, useRef } from "react"; // Usage function App() { // State value and setter for our example const [count, setCount] = useState(0); // Get the previous value (was passed into hook on last render) const prevC... Add solution -
Javascript 2021-09-21 14:13:03
useref material ui
// Using the useRef() hook. Only possible when you're using a function component. const App = () => { const textRef = useRef(); const showRefContent = () => { console.log(textRef.current.value); }; return ( <div className="Ap... Add solution