Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.ui

Avoid React.createFactory

`createFactory` is a legacy helper for pre-JSX code and is removed from modern React typings and guidance.

#Metadata

Rule ID
ts.react.no-deprecated-create-factory
Severity
low
Confidence
0.86
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
react, rules-catalog, ui

#Why it matters

Function components and JSX provide clearer element construction without the indirection and weaker typing of factory helpers.

#Remediation

Inline JSX, call `React.createElement` with explicit props, or convert the call site to a small function component.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-deprecated-create-factory.rule.yaml.