What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-22 20:31:11
immutability helper
import React, { Component } from "react"; import "./styles.css"; import update from "immutability-helper"; class App extends Component { state = { pizzas: { margherita: { toppings: ["tomato sauce&quo... Add solution -
Javascript 2022-01-22 15:55:45
how to use adminlte in reacts
import React, { Component } from 'react'; import AdminLTE, { Sidebar, Content, Row, Col, Box, Button } from 'adminlte-2-react'; const { Item } = Sidebar; class HelloWorld extends Component { state = {} render() { return (<Content title="... Add solution -
Javascript 2022-01-22 08:10:08
how to spot Error: Maximum update depth exceeded. in react
import React, { Component } from 'react'; import styled from 'styled-components'; class Item extends React.Component { constructor(props) { super(props); this.toggle= this.toggle.bind(this); this.state = { det... Add solution -
Javascript 2022-01-22 04:41:09
react-hook-form
import React from 'react'; import { useForm } from 'react-hook-form'; function App() { const { register, handleSubmit, errors } = useForm(); // initialize the hook const onSubmit = (data) => { console.log(data); }; return ( <form o... Add solution -
Javascript 2021-11-22 00:52:15
formiks basic tutorial
import React from 'react'; import { useFormik } from 'formik'; const SignupForm = () => { // Pass the useFormik() hook initial form values and a submit function that will // be called when the form is submitted const formik = useFormik({ ini... Add solution -
TypeScript 2021-11-21 13:33:07
refreshcontrol
import React from 'react'; import { RefreshControl, SafeAreaView, ScrollView, StyleSheet, Text } from 'react-native'; const wait = (timeout) => { return new Promise(resolve => setTimeout(resolve, timeout)); } const App = () => { const [refr... Add solution -
Javascript 2021-11-21 12:29:15
@reach/router
import React from "react" import { render } from "react-dom" import { Router, Link } from "@reach/router" let Home = () => <div>Home</div> let Dash = () => <div>Dash</div> render( <Router&... Add solution -
Javascript 2021-11-21 11:56:38
how to redirect react router from the app components
import React from 'react' import { Redirect } from 'react-router-dom' const ProtectedComponent = () => { if (authFails) return <Redirect to='/login' /> } return <div> My Protected Component </div> } Add solution