Closed oeyoews closed 7 months ago
在 BooleanPropGood 组件中,当 HungryMessage 组件的 isHungry prop 未显式传递时,默认为 true。这是因为在 React 中,当你不提供某个 prop 时,它会被默认为 true。所以,第一个 HungryMessage 没有显式传递 isHungry,因此它的 isHungry prop 默认为 true。
BooleanPropGood
HungryMessage
isHungry
true
在
BooleanPropGood
组件中,当HungryMessage
组件的isHungry
prop 未显式传递时,默认为true
。这是因为在 React 中,当你不提供某个 prop 时,它会被默认为true
。所以,第一个HungryMessage
没有显式传递isHungry
,因此它的isHungry
prop 默认为true
。