React

Name
Definition
React components created with a function()

  • TypeScript support
Cons:
  • No SEO

  • Change public/index.html: <title>
  • Change public/mainfest.json

Difficult and heavy
  • Requires relay-compiler
    • Requires exporting a schema from your graphql endpoint

yarn create react-app my-app --typescript

  • No const enum

src/components
src/containers
src/routes/EntriesRoute.tsx

await-useEffect.tsx
function Render() {
const [data, setData] = useState(null);
const fetchData = async() => {
const response = await fetch(`https://www.example.com/`);
const json = await response.json();
setData(json);
};
useEffect(() => { fetchData() });
return <div>Test</div>
}

Error:
Type error: Cannot assign to 'current' because it is a read-only property. TS2540
By default if you create a ref with a null default value and specify its generic parameter you're signaling your intent to have React "own" the reference. If you want to be able to mutate a ref that you own you should declare it like so:
Solution:
  • Change useRef<T | null>(null) to useRef<T>()

Use reactstrap
Copy link
On this page
Glossary
Create React App
Default
Relay
SEO
TypeScript
Directory Structure
useEffect with async/await
useRef(null)
Bootstrap