What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-05 15:24:02
Safari autoplay audio
const soundEffect = new Audio(); // onClick of first interaction on page before I need the sounds soundEffect.play(); // later on when you actually want to play a sound at any point without user interaction soundEffect.src = 'path/to/file.mp3'; soundEff... Add solution -
Javascript 2021-09-05 15:18:02
react get input value on button click functional component
const input = props => { let textInput = React.createRef(); function handleClick() { console.log(textInput.current.value); } return ( <div> <input ref={textInput} placeholder="Type a message..." /> <div onC... Add solution -
Javascript 2021-09-04 22:37:01
How to build an Alert using useEffect
import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; function LifecycleDemo() { // Pass useEffect a function useEffect(() => { // This gets called after every render, by default // (the first one, and every... Add solution -
Javascript 2021-09-04 17:10:01
using redux with hooks
import React from "react"; import { useDispatch, useSelector } from "react-redux"; import { addCount } from "./store/counter/actions"; export const Count = () => { const count = useSelector(state => state.counter.cou... Add solution
Best helpers
Ranking is empty