Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react hooks in codepen

/*
   1. Click on "Open js setting" in codepen
   2. Click on "js" under the pen settings
   3. On the right-hand-side, scroll down to "Add External Scripts/Pens"
   4. Search and add "react" or copy and paste the cdn below:
    https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js
   5. Click on "save and close"
   6. Use the following code in your editor.
*/

const { useState, useEffect } = React;

const counter = () => {
	const [counter, setCounter] = useState(25)
    
    return <h1>{counter}</h1>
}

// With love @kouqhar
Comment

PREVIOUS NEXT
Code Example
Javascript :: ionic vue use .env 
Javascript :: image load fail event html 
Javascript :: React Redux reducer crud 
Javascript :: how to create an async function from a string in node js 
Javascript :: remove an item from the end of an array 
Javascript :: Find largest number from array by function in javascript 
Javascript :: print json object 
Javascript :: what is the use of useparams in react 
Javascript :: how to fetch data from json file in flutter 
Javascript :: active class always appear in navlink 
Javascript :: select div with clas 
Javascript :: scroll div horizontally with move wheel js 
Javascript :: addeventlistener javascript multiple functions 
Javascript :: Using Props In React: Assigning CSS 
Javascript :: javascript event listener get id of clicked items 
Javascript :: download string as file express js 
Javascript :: react rating stars component 
Javascript :: apollo graphql 
Javascript :: react useeffect on change props 
Javascript :: what is undefined in javascript 
Javascript :: on:click svelte arguments 
Javascript :: find the max number in an array js 
Javascript :: comparing html text by using jquery 
Javascript :: how to access items inside anonymous object 
Javascript :: localstorage syntax 
Javascript :: extends in js 
Javascript :: js not startswith 
Javascript :: javascript set value to the largest value in an array 
Javascript :: what is shortest javascript program 
Javascript :: javascript sort array 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =