ts-react-directives is a small React/Typescript library designed to mimic 'Angular' ngIf, ngFor directives. And uses declarative syntax for logic branching and iteration.
Check/If/ElseIf/Else—JSXtags for conditional branching.Loop— tags for iterative logic.- TypeScript — fully supported.
- Nestable logic — tags can be nested logically.
- Validation — dead-lock, crash-detection and ordinal validation.
- Stable id — automatically add stable
key, between render teardown for iterable items. - No ternary soup — declarative markup to avoid ternary nesting.
- Tree-shakeable builds — published as ESM, CJS and UMD with bundled type declarations.
- Zero runtime dependencies — only
react/react-domas peers. - Opt-in error reporting — malformed directives can render a styled, in-place error list while developing, and are silent by default in production.
- Precompiled styles — ships its own compiled stylesheet.
For features and how-to get started Refer to the developer guide. It demonstrates how to use the the library. If you want to see it an action refer to the demo below.
- Developer guide - features, installation, usage, SSR support, error configuration and styling: DEVELOPER.md
- Security policy - supported versions and how to report a vulnerability: SECURITY.md
- License - MIT: LICENSE.md
- Authors - AUTHORS.md
- Add breakOn and continueOn capability
- Add filters
- Exhaustive unit tests for loops
- Refactor unit tests
Open bug reports and feature requests at GitHub Issues.