microsoft / microsoft/TypeScript

Revaluate default props behavior in JSX functional components

Open
#36,433 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Proposal Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Regarding the recognition of default initializers as part of type checking on functional components, I believe issues #32402 and #31247 should be reevaluated in the light of #34547 and the potential deprecation of defaultProps, and also on the own merits of both issues.

TypeScript Version: 3.7.5

Search Terms:
defaulProps, FunctionalComponent, JSX, React

Code
View issues #32402 and #31247

Expected behavior:
View issues #32402 and #31247

Actual behavior:
View issues #32402 and #31247

Playground Link:
View issues #32402 and #31247

Related Issues:
Issues #32402 and #31247 =D

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 reading issues #32402 and #31247, then compare their proposals with issue #34547 and the discussion about deprecating defaultProps. The payload names no source files, tests, or entry points; the work is complete only after the intended JSX functional-component type-checking behavior is agreed and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
compilers, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.