Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/udibo_react_app/mod.tsx

A React Framework for Deno that makes it easy to create highly interactive apps that have server side rendering with file based routing for both your UI and API.
Go to Latest
import * as udiboReactApp from "https://deno.land/x/udibo_react_app@0.11.0/mod.tsx";

Classes

An error for an HTTP request.

Variables

A function that takes a string key representing an environment variable and returns its value. If the code is running on the server, it uses the Deno.env.get function to retrieve the value of the environment variable. Otherwise it retrieves it from the browser's app.env object. The app.env object is used for internal purposes only.

A function that returns a boolean indicating whether the code is running in the browser or not.

A function that returns a boolean indicating whether the code is running in the development environment or not.

A function that returns a boolean indicating whether the code is running in the production environment or not.

A function that returns a boolean indicating whether the code is running on the server or not.

A function that returns a boolean indicating whether the code is running in the test environment or not.

Functions

A component that captures any errors within the boundary. Unlike ErrorBoundary, the AppErrorBoundary can be used to render errors on the server. For the error on the server to be caught by it, it must have the same boundary.

A function that creates a React context object for the app. It takes an optional generic parameter representing the type of the initial value of the context. The context object created can hold any app-specific data, and its state will be serialized and shared with the browser.

A simple error fallback component that can be used to show the error and provide a button for trying again. It takes a FallbackProps object with an error property, which represents the error that occurred, and a resetErrorBoundary function which is used to reset the error boundary. The error boundary automatically resets if the location changes.

This function is used to hydrate the application in the browser. It turns the server rendered application into a single-page application (SPA). Hydration is not required if only server-side rendering is desired.

Checks if the value as an HttpError.

A function used to lazily load a component. This function takes in a factory that returns Promise that resolves to a React component. The purpose of this function is to automatically add error boundaries to routes with an ErrorFallback or boundary export. This function is intended for internal use only, and is typically used in the generated _main.tsx file for a routes directory.

A component that can be used to throw a 404 not found error. It is used as the default wildcard route at the top level of the app.

A hook that automatically resets the error boundary if the location changes. It takes a reset function and generates a new reset function that prevents multiple calls to the reset callback.

A higher-order component that wraps a component with an AppErrorBoundary. Any errors within the boundary will be captured by it. Unlike withErrorBoundary, withAppErrorBoundary can be used to render errors on the server. For the error on the server to be caught by it, it must have the same boundary.

Interfaces

Used to represent environment variables shared with the browser.

Options for initializing an HttpError.

An interface that defines the configuration for the application's hydration.

Type Aliases

An interface that defines a route file. A route file exports a react component by default. It can optionally export an ErrorFallback or boundary that will be used for an AppErrorBoundary around the react component that it exports by default.