Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added null to parent parameter union type of render #937

Merged
merged 1 commit into from Dec 3, 2017
Merged

Added null to parent parameter union type of render #937

merged 1 commit into from Dec 3, 2017

Conversation

nickytonline
Copy link
Sponsor Contributor

Fixes #936.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 632a836 on nickytonline:dx/update-typescript-definitions into d6fa22b on developit:master.

@nickytonline nickytonline changed the title Added null to paren union type of render Added null to parent parameter union type of render Nov 20, 2017
This is require because when TypeScript has `strictNullChecks` set to true, in tsconfig.json, it errors out.

e.g.

```
import { render, h } from 'preact';
import TodoList from './components/todo-list';

const root = document.getElementById('root');

render(<TodoList />, root);
```

results in

```
TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Document | Element'.
  Type 'null' is not assignable to type 'Document | Element'.
```
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 25f336a on nickytonline:dx/update-typescript-definitions into 18878f4 on developit:master.

Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@developit developit merged commit ffe3169 into preactjs:master Dec 3, 2017
@nickytonline nickytonline deleted the dx/update-typescript-definitions branch December 3, 2017 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants