Post

propsの宣言のvalueの謎の?(クエスチョンマーク)の意味

未解決

意味がわかりそうで分からない。

type A = { prop?: T } means that object can have prop of type T or do not have it at all. type B = { prop: ?T } means that object always have prop, it can be of type T or null. type C = { prop?: ?T } means that object can have prop, it can be of type T or null or do not have prop at all.

Optional state property in react component got an error when setState with null · Issue #5377 · facebook/flow · GitHub

This post is licensed under CC BY 4.0 by the author.