Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
ryanflorence / fasdfas
Created Apr 23, 2021
Created from Remix Form!
@ryanflorence
ryanflorence / more stuff
Created Apr 23, 2021
Created from Remix Form!
@ryanflorence
ryanflorence / no js
Created Apr 23, 2021
Created from Remix Form!
View no js
hey hey
@ryanflorence
ryanflorence / mutations.md
Created Apr 23, 2021
Created from Remix Form!
@ryanflorence
ryanflorence / blah.md
Created Apr 23, 2021
Created from Remix Form!
View blah.md

hello hello

View email.tsx
import type {
ActionFunction,
LinksFunction,
LoaderFunction,
MetaFunction
} from "@remix-run/react";
import {
Meta,
Links,
Scripts,
View server.js
const path = require("path");
const express = require("express");
const compression = require("compression");
const morgan = require("morgan");
const { createRequestHandler } = require("@remix-run/express");
////////////////////////////////////////////////////////////////////////////////
let app = express();
app.use(compression());
View all-my-react-components.tsx
enum State {
Idle,
LoadingJwt,
Success,
Error,
}
type Data = { error?: string; jwt?: string };
function Comp() {
View CopyButton.tsx
import React from "react";
import { IconCopy } from "./icons";
export default function CopyButton({ value }) {
let [copied, setCopied] = React.useState(false);
React.useEffect(() => {
if (copied) {
let id = setTimeout(() => {
setCopied(false);
View data-outside-of-navigation.md

Calling Loaders/Actions Outside of Navigation

Some might call them "API routes".

Use cases:

  • Combobox suggestions in a form.
    • This is not semantically navigation
  • Single action buttons that don't quite feel like navigation
    • like clicking a bunch of delete buttons really fast in a list