Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

[Docs]: Add Null return value type in code example #2429

Closed
wants to merge 1 commit into from
Closed

[Docs]: Add Null return value type in code example #2429

wants to merge 1 commit into from

Conversation

jacobdcastro
Copy link
Contributor

Summary

TypeScript threw this error when I attempted to copy and paste in my code:

Type 'null' is not assignable to type 'string'.ts(2322)

The getDefaultKeyBinding() method may return null. So I added | null to the return type declaration. Just thought it would help others who may also be copying/pasting the code!

Test Plan

No testing required.

TypeScript threw this error when I attempted to copy and paste in my code:
```
Type 'null' is not assignable to type 'string'.ts(2322)
```

The `getDefaultKeyBinding()` method may return null. So I added `| null` to the return type declaration. Just thought it would help others who may also be copying/pasting the code!
@mrkev
Copy link
Contributor

mrkev commented May 19, 2020

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@mrkev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

@mrkev merged this pull request in 45bb6b5.

vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this pull request Jul 16, 2020
Summary:
**Summary**

TypeScript threw this error when I attempted to copy and paste in my code:
```
Type 'null' is not assignable to type 'string'.ts(2322)
```

The `getDefaultKeyBinding()` method may return null. So I added `| null` to the return type declaration. Just thought it would help others who may also be copying/pasting the code!

**Test Plan**

No testing required.
Pull Request resolved: facebookarchive#2429

Reviewed By: kedromelon

Differential Revision: D21652264

Pulled By: mrkev

fbshipit-source-id: c820028da1ec6eb17055aceb5a751f7d01636b83
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

TypeScript threw this error when I attempted to copy and paste in my code:
```
Type 'null' is not assignable to type 'string'.ts(2322)
```

The `getDefaultKeyBinding()` method may return null. So I added `| null` to the return type declaration. Just thought it would help others who may also be copying/pasting the code!

**Test Plan**

No testing required.
Pull Request resolved: facebookarchive/draft-js#2429

Reviewed By: kedromelon

Differential Revision: D21652264

Pulled By: mrkev

fbshipit-source-id: c820028da1ec6eb17055aceb5a751f7d01636b83
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants