react: why static propTypes

前端 未结 2 1703
梦如初夏
梦如初夏 2021-01-31 07:32

I am looking the redux todomvc codes. What is the static keyword in static propTypes? Thanks

UPDATE

No idea why downvo

2条回答
  •  被撕碎了的回忆
    2021-01-31 07:56

    propTypes aren't unique to an instance of the component. They also don't change per component. Therefore it makes sense for them to be a static member of the class.

提交回复
热议问题