• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

developit / preact / 2655 / 1
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: fix/inproper_unmount
DEFAULT BRANCH: master
Ran 03 Mar 2019 01:42AM UTC
Files 18
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Mar 2019 01:39AM UTC coverage: 96.854%. Remained the same
2655.1

push

travis-ci

andrewiggins
Enable Typescript to understand JSX default props

See https://github.com/Microsoft/TypeScript/pull/24422

This addition allows a Component to use defaultProps without having to
declare them as optional, in a nutshell:

Before

class Before extends Component<{ prop?: string }> {
	static defaultProps = {
		prop: "default value"
	};

	render() {
		// this.props.prop is string|undefined
	}
}

const element = <Before />;

After

class After extends Component<{ prop: string }> {
	static defaultProps = {
		prop: "default value"
	};

	render() {
		// typeof this.props.prop is string
	}
}

const element = <After />;

The definition isn't perfect, it doesn't quite understand type unions where
the type of a single property changes, e.g.

{ type: "number"; value: number } | { type: "string"; value: string }

But this case doesn't break, it just would require you to still provide
a property.

There might be some more things we can do with LibraryManagedAttributes,
it could allow the children property to be correct within Components
(always an Array) whilst still allowing components to specify the type
of children they accept.

650 of 695 branches covered (93.53%)

708 of 731 relevant lines covered (96.85%)

402.31 hits per line

Source Files on job 2655.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 2498
  • Travis Job 2655.1
  • f225aaaa on github
  • Prev Job for on ceviche (#2652.1)
  • Next Job for on ceviche (#2656.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc