npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app
Love Api
Github & Gist Api
| const randomNumber = () => | |
| new Promise((res, rej) => | |
| setTimeout(() => { | |
| res("happy birthday"); | |
| }, 2000) | |
| ); | |
| console.log("Cool", await randomNumber()); |
| // Usage - | |
| //import {useFetch} from "./useFetch.js"; | |
| //const url = "https://raw.githubusercontent.com/ajzbc/kanye.rest/quotes/quotes.json"; | |
| //const {data, loading} = useFetch(url); | |
| // -- | |
| //Defining hook inside useFetch.js file. | |
| import { useEffect, useState, useRef } from "react"; | |
| export const useFetch = (url) => { | |
| const isMounted = useRef(true); |
| const JsonStringify = ({data}) => <pre>{JSON.stringify(data, null, 2)}</pre>; |
| //import {useField} from "../hooks/useField"; | |
| //const name = useField("text", "Enter name here"); | |
| //const age = useField("text", "Enter age here"); | |
| //const date = useField("date", "Enter date here"); | |
| //-- | |
| //<input {...name} /> | |
| //<input {...age} placeholder="Set more props here." /> | |
| //<input {...date} /> | |
| import {useState} from "react"; |
| <div><pre><b>|--Live-Debug--|</b>{JSON.stringify(values, null, 2)}</pre></div> |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
https://github.com/gaearon/react-side-effect http://blog.wolksoftware.com/contributing-to-definitelytyped how to generate types.d.ts file - google search https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node - Make a codesandbox for this demo. https://slides.com/ - make youraccount and see if it works for free account? https://www.youtube.com/watch?v=UxoX2faIgDQ - watching https://www.youtube.com/watch?v=kz3nVya45uQ - watching https://github.com/gothinkster/realworld - start, and fork it. https://gist.github.com/sahilrajput03/da93bcb44439c6951512dc6a59c2dc4f - idk whats this?? https://reactjs.org/docs/concurrent-mode-intro.html - react concurrent mode.