Skip to content

Instantly share code, notes, and snippets.

View stevoland's full-sized avatar

Stephen Collings stevoland

View GitHub Profile
@stevoland
stevoland / babel-plugin-react-hook-form-no-memo.md
Last active January 10, 2025 14:06
babel-plugin-react-hook-form-no-memo

react-hook-form (as of v7.53) may behave incorrectly when user code is compiled with react-compiler.

This babel plugin can be applied before the compiler to opt-out all functions which reference useForm by inserting the "use no memo" directive.

Only supports using the named export:

// worky
import { useForm } from 'react-hook-form
const Component = () => {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Session Export</title>
<style>
:root {
--accent: #8aadf4;
--border: #363a4f;
@stevoland
stevoland / opencode-jdtls-fix.ts
Created March 5, 2026 01:07
opencode-jdtls-fix
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
import type { Hooks, PluginInput } from '@opencode-ai/plugin';
import { $ } from 'bun';
import { JavaLspConfig } from '../config/schema';
import { log } from '../utils/logger';