Skip to content

Commit 1a4f141

Browse files
justin808claude
andcommitted
Fix TypeScript global declarations: use var instead of let
TypeScript requires 'var' (not 'let') in 'declare global' blocks to properly augment the global scope across all modules. This fixes build failures where TypeScript couldn't find ReactOnRails on globalThis. The previous commit accidentally reverted this change. Now properly using 'var' with the vars-on-top ESLint rule disabled. Fixes errors: - Property 'ReactOnRails' does not exist on type 'typeof globalThis' - Property '__REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__' does not exist 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a4b69e0 commit 1a4f141

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-on-rails/src/context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { ReactOnRailsInternal, RailsContext } from './types/index.ts';
22

33
declare global {
4-
/* eslint-disable no-underscore-dangle */
5-
let ReactOnRails: ReactOnRailsInternal | undefined;
6-
let __REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__: boolean;
7-
/* eslint-enable no-underscore-dangle */
4+
/* eslint-disable no-underscore-dangle, vars-on-top */
5+
var ReactOnRails: ReactOnRailsInternal | undefined;
6+
var __REACT_ON_RAILS_EVENT_HANDLERS_RAN_ONCE__: boolean;
7+
/* eslint-enable no-underscore-dangle, vars-on-top */
88
}
99

1010
let currentRailsContext: RailsContext | null = null;

0 commit comments

Comments
 (0)