basarat / basarat/typescript-book

ReactJS Default props

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

``` ts
interface PageProps {
foo?: string;
}

export class PageComponent extends React.Component {
public static defaultProps: PageProps = {
foo: "default"
};

public render() {
return (
Hello, world
);
}
}
```

Contributor guide

Open the contributing guide

Research direction

The issue contains only a TypeScript React component example and names no file, test, or requested outcome. First clarify whether it seeks documentation or a correction about defaultProps; then locate the relevant React and TypeScript book section and define the expected example.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.