arcthur / react-book-examples

深入 React 技术栈一书中示例

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TabContent代码的疑问

purelanren opened this issue · comments

https://github.com/arcthur/react-book-examples/blob/master/01/js/TabContent.js#L13

  • 其中的isActive 这个props的作用是什么,个人认为这个不是TabContent应该关心的props,TabContent应该关心activeIndex 就行了
  • 另外下面的childen.map中又重新定义了一个命名有冲突的isActive,虽然我认为此处才是真正应该得到isActive的地方,但命名规范似乎欠妥

这里的 isActive 传下来的确是多余的,下面 isActive 是传给 pane 用的,命令 isActive 应该可以。
谢谢~