UNPKG

react-on-rails

Version:

react-on-rails JavaScript for react_on_rails Ruby gem

19 lines 1.08 kB
import { createCoreCapability } from "./capabilities/core.js"; import { createLifecycleCapability } from "./capabilities/lifecycle.js"; import createReactOnRails from "./createReactOnRails.js"; import ComponentRegistry from "./ComponentRegistry.js"; import StoreRegistry from "./StoreRegistry.js"; import { clientStartup } from "./clientStartup.js"; const registries = { ComponentRegistry, StoreRegistry }; const currentGlobal = globalThis.ReactOnRails || null; const ReactOnRails = createReactOnRails([createCoreCapability(registries), createLifecycleCapability()], { currentGlobal, // Defer startup to the next tick so all synchronous <script> tags finish evaluating // before we scan the DOM for components. Pro's proClientStartup runs synchronously // because streaming hydration needs to attach listeners before the first paint. startup: typeof window !== 'undefined' ? () => setTimeout(() => clientStartup(), 0) : null, registries, }); export * from "./types/index.js"; export default ReactOnRails; //# sourceMappingURL=ReactOnRails.client.js.map