microsoft / microsoft/TypeScript

JSX: Add a way to specify children as not a part of props

Open
#18,357 3 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: JSX/TSX In Discussion Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Right now there's no way to specify what children representation is, except specifying ElementChildrenAttribute inside JSX namespace. It's heavily coupled with React representation for children which implies that children is a part of props. This makes impossible to enable type checking for children with implementations which store children separately, for instance https://github.com/dfilatov/vidom/wiki/Component-properties.
Probably it could be ElementChildrenProperty (like ElementAttributesProperty).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining TypeScript's JSX type-checking behavior, especially the JSX namespace hooks ElementChildrenAttribute and ElementAttributesProperty. Determine how a separate children representation could be specified and define completion as type checking children for implementations that do not store them in props, with coverage for the proposed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.