Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
/** | |
* A quick way of using Markdown inside JSX: via tagged templates | |
* | |
* Downsides: | |
* – Works completely dynamically (no static compilation) | |
* – Big downside: You must escape backticks. | |
* Potential work-around in template tag function: result.replace(/∆/ug, '`') | |
* | |
* Upsides: | |
* – Preserves line breaks (JSX doesn’t) |
import React, { useState, useMemo } from "react"; | |
export default function SimpleStateHooks() { | |
const [count, setCount] = useState(1000); | |
function returnValue(inputValue) { | |
return inputValue + 10; | |
} | |
var calculatedValue = useMemo(() => returnValue(10), [10]); |
import * as React from "react"; | |
import { render } from "react-dom"; | |
import produce from "immer"; | |
import { set, has } from "lodash"; | |
import "./styles.css"; | |
function enhancedReducer(state, updateArg) { | |
// check if the type of update argument is a callback function | |
if (updateArg.constructor === Function) { |
export const useFocus = () => { | |
const htmlElRef = useRef<HTMLElement>() | |
const setFocus = () => { | |
const currentEl = htmlElRef.current | |
currentEl && currentEl.focus() | |
} | |
return [setFocus, htmlElRef] as const | |
} |
import { useEffect, useRef } from 'react'; | |
function getItem(storage, key) { | |
const value = storage.getItem(key); | |
if (!value) return null; | |
try { | |
return JSON.parse(value); | |
} catch (error) { |
FROM ruby:2.6.1 | |
ARG PG_VERSION | |
ARG NODE_VERSION | |
ARG TINI_VERSION=v0.18.0 | |
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | |
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' $PG_VERSION > /etc/apt/sources.list.d/pgdg.list \ | |
&& curl -o /tmp/nodejs.deb https://deb.nodesource.com/node_11.x/pool/main/n/nodejs/nodejs_$NODE_VERSION-1nodesource1_amd64.deb \ | |
&& apt-get update -qq \ |
This is the CFP for my React Rally talk, which was eventually accepted and given here: https://www.youtube.com/watch?v=nyFHR0dDZo0.
If you are a first time speaker, my CFP advice for new speakers is here.
Functional-reactive libraries like RxJS make it easy to understand how data changes, giving us tools to declaratively handle events and manage state. But while our render methods react to state changes, React isn’t reactive. Instead, we write imperative event-handlers, and trip up on gotchas like async setState and race conditions. Why? In this talk we build a Reactive React to show the difference between the "push" and "pull" paradigms of data flow and understand why React chooses to manage Scheduling as a core Design Principle, enabling awesome features like async rendering and Suspense!
Theme: This talk is a deep dive into React's core design principle around scheduling. Instead of abstr
VUECONF2019 PRESENTATION LINKS |