CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-react

React is a JavaScript library for building user interfaces through a declarative, component-based approach.

Pending
Overview
Eval results
Files

development.mddocs/

Development APIs

Testing, debugging, and internal APIs.

act

Batches updates for testing.

function act(callback: () => void | Promise<void>): Promise<void>;
import { act } from 'react';
import { createRoot } from 'react-dom/client';

test('updates state', async () => {
  const root = createRoot(document.createElement('div'));
  
  await act(async () => root.render(<Counter />));
  await act(async () => button.click());
  
  expect(container.textContent).toBe('Count: 1');
});

captureOwnerStack

Debug stack traces (dev only).

function captureOwnerStack(): string | null;
if (process.env.NODE_ENV === 'development') {
  const stack = captureOwnerStack();
  console.log('Rendered from:', stack);
}

version

React version string.

const version: string;
console.log('React version:', version);  // "19.2.0"

Internal APIs

  • __COMPILER_RUNTIME - Used by React Compiler
  • __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE - React internal state

Warning: These are internal only and should not be used in application code.

Install with Tessl CLI

npx tessl i tessl/npm-react

docs

built-in-components.md

caching.md

children.md

components.md

composition.md

context.md

development.md

elements.md

experimental.md

hooks-context.md

hooks-effects.md

hooks-imperative.md

hooks-performance.md

hooks-state.md

hooks-transitions.md

index.md

refs.md

transitions.md

tile.json