Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Typings: correct typings to match propTypes #548

Closed
layershifter opened this issue Nov 30, 2018 · 7 comments
Closed

Typings: correct typings to match propTypes #548

layershifter opened this issue Nov 30, 2018 · 7 comments
Assignees
Labels
🧰 bug Something isn't working vsts Paired with ticket in vsts

Comments

@layershifter
Copy link
Member

Bug Report

The latest release of @types/react with TS 3.2 breaks all our builds on Project Tests stage.

Steps

Build any PR.

Expected Result

CI pass.

Actual Result

image

@layershifter
Copy link
Member Author

@layershifter layershifter changed the title "Project tests" is broken "Project tests" is broken in CI Nov 30, 2018
@layershifter
Copy link
Member Author

An example of failed build #549.

@layershifter
Copy link
Member Author

It's not clear to me what will be done with these changes in @types/react.

I think that for now the best option for us will be use yarn's resolutions to get the stable release of @types/react.

@pkumarie2011 pkumarie2011 added the vsts Paired with ticket in vsts label Nov 30, 2018
@layershifter
Copy link
Member Author

@layershifter
Copy link
Member Author

Proposed solution:

type Optional<T> = T | null | undefined 
-interface CProps {
-  required?: boolean
-  type?: string
-}
+interface CProps {
+  required: Optional<boolean>
+  type: Optional<string>
+}

@layershifter
Copy link
Member Author

@levithomason levithomason added 🧰 bug Something isn't working and removed 🧰 bug Something isn't working labels Nov 30, 2018
@layershifter
Copy link
Member Author

We decided to go with:

type Nullable<T> = T | null
-interface CProps {
-  required?: boolean
-  type?: string
-}
+interface CProps {
+  required: Nullable<boolean>
+  type: Nullable<string>
+}

@layershifter layershifter changed the title "Project tests" is broken in CI Typings: correct typings to match propTypes Dec 3, 2018
@layershifter layershifter self-assigned this Dec 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 bug Something isn't working vsts Paired with ticket in vsts
Projects
None yet
Development

No branches or pull requests

3 participants