What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-11 03:04:15
logout google account on aws amplify app
import Amplify, { Auth, Hub } from 'aws-amplify'; import awsconfig from './aws-exports'; Amplify.configure(awsconfig); class App extends Component { state = { user: null, customState: null }; componentDidMount() { Hub.listen("auth", ({... Add solution -
Javascript 2021-11-06 09:22:36
react native how to pass id from list to function
render(){ return( <ul id="todo"> {this.state.items.map((item,i) => <li className='list-group-item' key={i} data-id={item.id}>{item.name} <button onClick={() => this.yourfunc(item.id)}>X<... Add solution -
Javascript 2021-11-03 14:24:09
change state in react
import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> ... Add solution -
Other 2021-11-02 17:23:10
componentDidmount event on fonctional component
import React, { useState, useEffect } from 'react'; function Example() { const [count, setCount] = useState(0); // Similaire à componentDidMount et componentDidUpdate : useEffect(() => { // Met à jour le titre du document via l&r... Add solution -
Javascript 2021-10-27 19:26:08
automated counter with react hooks
import React, { useState } from 'react'; function Example() { // Declaración de una variable de estado que llamaremos "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times&l... Add solution -
Javascript 2021-10-27 09:12:07
react return action in a function
import React, {useState} from 'react'; // Create a callback in the probs, in this case we call it 'callback' function newCallback(callback) { callback('This can be any value you want to return') } const Callback = () => { const [callbackData, setC... Add solution -
Javascript 2021-10-27 06:42:13
reawct uweeffect
import React, { useState, useEffect } from 'react'; function Example() { const [count, setCount] = useState(0); // Similar to componentDidMount and componentDidUpdate: useEffect(() => { // Update the document title using the browser API ... Add solution -
Javascript 2021-10-26 19:58:08
toast notification bootstrap react js github
import { useToasts } from 'react-toast-notifications' export const ToastDemo = ({ content }) => { const { addToast } = useToasts() return ( <Button onClick={() => addToast(content, { appearance: 'warning', autoDismiss: true, ... Add solution
Best helpers
Ranking is empty