Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
ryanflorence / fasdfas
Created April 23, 2021 19:35
Created from Remix Form!
asdfasdf
@ryanflorence
ryanflorence / more stuff
Created April 23, 2021 19:35
Created from Remix Form!
blah blah
@ryanflorence
ryanflorence / no js
Created April 23, 2021 19:34
Created from Remix Form!
hey hey
@ryanflorence
ryanflorence / mutations.md
Created April 23, 2021 19:33
Created from Remix Form!

hello hello

@ryanflorence
ryanflorence / blah.md
Created April 23, 2021 19:32
Created from Remix Form!

hello hello

import type {
ActionFunction,
LinksFunction,
LoaderFunction,
MetaFunction
} from "@remix-run/react";
import {
Meta,
Links,
Scripts,
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());
enum State {
Idle,
LoadingJwt,
Success,
Error,
}
type Data = { error?: string; jwt?: string };
function Comp() {
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);

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