git init
or
env vars:
SLACK_WEBHOOK_URL
CRAIGSLIST_SEARCH_URL=https://sfbay.craigslist.org/search/sfc/apa?query=glen+park&hasPic=1&postedToday=1&availabilityMode=0&sale_date=all+dates
SLACK_ICON_URL
function setFocusIfFocusable(node) { | |
if (node.nodeType !== Node.ELEMENT_NODE) { | |
// Text and comment nodes aren't focusable. | |
return false; | |
} | |
if (node.disabled === true) { | |
// Disabled elements can't be focused. | |
return false; | |
} |
Create React App 4.0 is currently in alpha and supports using React 17 and the new JSX transform. To use it, follow these instructions.
Create a new app with npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
const minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps
and such. Instead you do client-only fetching with swr
, react-query
, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.