What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-06 13:54:03
chrome back button click event react
import { useHistory } from 'react-router-dom' const [ locationKeys, setLocationKeys ] = useState([]) const history = useHistory() useEffect(() => { return history.listen(location => { if (history.action === 'PUSH') { setLocationKeys([... Add solution -
Javascript 2021-09-20 19:20:03
select value from select and pass it to useeffect
const GetAPILinks = () => { const [apiData, setApiData] = React.useState([]); const [fetchUrl, setFetchUrl] = React.useState(''); React.useEffect(() => { if (fetchUrl) { fetch(fetchUrl) .then((response) => { retu... Add solution -
Javascript 2021-09-17 20:40:02
react eznyme fetch api using hooks
//app.js import React from 'react' import FetchData from './FetchData' const fetchUsers = () => fetch('https://jsonplaceholder.typicode.com/users').then((res) => res.json()) function App() { return ( <> <FetchData fetchUsers={... Add solution -
Javascript 2021-09-08 10:44:02
make a fixed list in react native
export default function App() { const [enteredGoal,setEnteredGoal] = useState(''); const [courseGoals, setCourseGoals] = useState([]); const goalInputHandler = (enteredText) => { setEnteredGoal(enteredText); } const addGoalHandler = () =&... Add solution