What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-16 00:31:02
react useeffect not on first render
//This is a way to build this effect as a custom hook import React, { useEffect, useRef } from 'react'; const useDidMountEffect = (func, deps) => { const didMount = useRef(false); useEffect(() => { if (didMount.current) func(); ... Add solution -
Javascript 2021-09-14 22:06:01
private routes in react
import React from 'react'; import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom'; import decode from 'jwt-decode'; import Home from './Home'; import Register from './Register'; import Login from './Login'; import PrivateCompon... Add solution -
Javascript 2021-09-14 20:43:02
fc calendar
import React from 'react' import FullCalendar from '@fullcalendar/react' // must go before plugins import dayGridPlugin from '@fullcalendar/daygrid' // a plugin! export default class DemoApp extends React.Component { render() { return ( <F... Add solution -
Javascript 2021-09-14 12:51:03
cascading dropdown for forms react
import React from 'react'; class Dropdown extends React.Component { constructor(props) { super(props); this.state = { countries : [], states : [], cities : [], selectedCountry : '--Choose Country--', selectedState : '--Choose State--'... Add solution -
Javascript 2021-09-14 10:04:04
clock reactjs
import React, { useState } from 'react' const Clock = ({ theme }) => { // For digital clock let time = new Date().toLocaleTimeString(); let [ctime, setCTime] = useState(); const updateTime = () => { time = new Date().toLocaleTimeString(); s... Add solution -
Html 2021-09-14 08:24:04
get var from child vue
add an event to your child call in the parent template like that event is the name of the event <component @event="action"/> the action could be a function call or var interaction and then in your child you must create an event In the ... Add solution -
Javascript 2021-09-14 00:18:02
React microphone
import React, { useState, useEffect } from 'react'; // the button form material-ui is optional // npm install @material-ui/core import Button from '@material-ui/core/Button'; const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechReco... Add solution
Best helpers
Ranking is empty