# AlexGilleran/jsx-control-statements

Neater If and For for React JSX

Repository: https://github.com/AlexGilleran/jsx-control-statements
Canonical: https://ross.abutalabs.com/products/jsx-control-statements
Homepage: https://www.npmjs.com/package/babel-plugin-jsx-control-statements
Language: JavaScript
License: MIT
License Family: permissive
Topics: javascript, react, jsx, babel, babel-plugin
Last push: 2023-01-05T16:15:45+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4213, "days_push": 1336, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1621, forks 60 (observed 2026-08-28T04:05:12.424160+00:00)

## What it is
A Babel plugin that adds component-like If, For, Choose, and With control statements to JSX, transforming them into plain JavaScript expressions at build time. It keeps React render functions readable without introducing runtime components.

## Use cases
- write if/else conditionals in JSX without ternaries
- render lists in JSX with a for loop syntax
- clean up nested conditional rendering in React components
- migrate from Handlebars-style templating to React
- simplify switch-like rendering with Choose/When/Otherwise

## When to choose
- you prefer declarative control-flow syntax over && and map in JSX
- your project uses Babel and plain JavaScript without TypeScript
- you want render functions that read like templating libraries

## When to avoid
- you use TypeScript, Flow, or static analysis tools that may break on transformed code
- you want to stay on the well-supported path of plain JavaScript expressions
- your project no longer maintains a Babel build pipeline

## Facets
- artifact type: plugin
- maturity: maintenance
- function: templating, build-tool
- domain: frontend, web-development
- platform: browser
- tags: react, jsx, babel-plugin, conditionals, loops, nodejs

## Member repositories
- AlexGilleran/jsx-control-statements (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:12.424160+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:49:03.510731+00:00, confidence not recorded.
  - readme: https://github.com/AlexGilleran/jsx-control-statements (fetched 2026-08-28T04:05:12.424160+00:00, sha 31d4dfc51c6f)
  - registry_npm: https://registry.npmjs.org/jsx-control-statements (fetched 2026-08-29T11:21:58.085165+00:00, sha c781d45bd3ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
