npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tactical-ddd/react

v0.1.2

Published

[![npm version](https://img.shields.io/npm/v/@tactical-ddd/react)](https://www.npmjs.com/package/@tactical-ddd/react) [![npm downloads](https://img.shields.io/npm/dm/@tactical-ddd/react)](https://www.npmjs.com/package/@tactical-ddd/react) [![license](http

Downloads

1,398

Readme

npm version npm downloads license CI codecov

@tactical-ddd/react

@tactical-ddd/react is the React layer of the @tactical-ddd ecosystem — a collection of shared, domain-agnostic React building blocks (components, hooks, and utilities) for applications structured around Domain-Driven Design (DDD) and Clean Architecture.

It is platform-neutral: the helpers depend only on react itself, so the same package can be consumed by web apps (React DOM) and native apps (React Native) alike.

Philosophy

In a DDD / Clean Architecture workspace, business logic lives inside isolated domains and the framework details stay at the edges. This package is the shared React kernel that sits beneath those domains:

  • It holds only generic, reusable React primitives — never business logic tied to a specific domain.
  • Domains and feature layers (libs/[domain]/features) may import from it; it must never import back from any domain.
  • Everything here is framework-presentation glue (composition helpers, hooks, wrappers), keeping the domain core layers pure and free of React.

The suite is being built out incrementally. Utilities currently available:

More components, hooks, and utilities are planned. This document covers what ships today.

Installation

npm install @tactical-ddd/react
# peer dependency
npm install react

Utilities

composeProviders

When an app wires up dependency injection, theming, query clients, routing, and per-domain context, the root tree quickly degrades into a "provider pyramid":

<ThemeProvider theme={theme}>
  <QueryProvider client={client}>
    <AuthProvider user={user}>
      <RouterProvider router={router}>
        <App />
      </RouterProvider>
    </AuthProvider>
  </QueryProvider>
</ThemeProvider>

createComposeProviders removes that nesting by accepting a flat, ordered list of providers and returning a single component that wraps its children with all of them. createProvider is a small helper that pairs a provider component with its props in a type-safe way.

import { createComposeProviders, createProvider } from '@tactical-ddd/react';

const AppProviders = createComposeProviders([
  createProvider(ThemeProvider, { theme }),
  createProvider(QueryProvider, { client }),
  createProvider(AuthProvider, { user }),
  createProvider(RouterProvider, { router }),
]);

// Usage
<AppProviders>
  <App />
</AppProviders>;

Ordering: providers are nested in array order — the first entry is the outermost wrapper and the last is the innermost. That means a context supplied by an earlier provider is available to every provider (and child) that follows it.

API

createProvider(Component, props?)

Creates a type-safe provider descriptor. props are checked against the component's own props (with children omitted) and may be left out for providers that take none.

createProvider<TProps extends object>(
  Component: ComponentType<PropsWithChildren<TProps>>,
  props?: Omit<TProps, 'children'>,
): Provider<TProps>;
createComposeProviders(providers)

Takes an array of provider descriptors and returns a single ComponentType<PropsWithChildren> that renders them nested from first (outer) to last (inner).

createComposeProviders(
  providers: Array<Provider<any>>,
): ComponentType<PropsWithChildren>;

Running unit tests

Run nx test @tactical-ddd/react to execute the unit tests via Jest and React Testing Library.