Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
ryanflorence / question.ts
Created January 12, 2021 21:48
generic generics?
// My DB has multiple collections (tables), they can extend
// this since the only difference is the data an collection,
// they're passed in as generics
export interface Record<TData, TCollection> {
data: TData;
ref: {
collection: {
id: TCollection;
};
id: string;
@ryanflorence
ryanflorence / $post.edit.tsx
Last active March 9, 2022 22:50
The Anatomy of a Remix Route
/**
* The Anatomy of a Remix Route
*/
import { parseFormBody, json, redirect } from "@remix-run/data";
import {
Form,
useRouteData,
usePendingFormSubmit,
preload,
} from "@remix-run/react";
declare module "@architect/functions" {
/**
* Requests are passed to your handler function in an object, and include the following parameters
*/
export interface Request {
/**
* Payload version (e.g. 2.0)
*/
version: string;

Route Transition API

Definitions

The goal of the route transition API is to enable suspense-like transition in React Router without using Suspense (much like v1).

On location changes, React Router will continue to send down the old location, activating pending hooks for loading states and optimistic UI, and wait for your Route's preloading hooks to resolve before sending down the new location and updating your app.

This enables you to declare data dependencies on your routes, allowing your route elements to expect data and not need to manage their own loading states.

@ryanflorence
ryanflorence / Some gist.md
Created November 24, 2020 22:28
Created from Remix Form!

YOOOOOOO

console.log("hey");
@ryanflorence
ryanflorence / fasdf
Created November 24, 2020 05:54
Created from Remix Form!
asdfa
@ryanflorence
ryanflorence / SPINNING
Created November 24, 2020 05:42
Created from Remix Form!
yep
@ryanflorence
ryanflorence / with a spinner
Created November 24, 2020 05:41
Created from Remix Form!
so cool
@ryanflorence
ryanflorence / coolio
Created November 24, 2020 05:35
Created from Remix Form!
So cool
@ryanflorence
ryanflorence / farty fart
Created November 24, 2020 05:31
Created from Remix Form!
fart fart fart