MorningStar0

React 中多处复用的组件封装,是 props 越多越好,还是越少越好?

  •  1
     
  •   MorningStar0 · May 7, 2020 · 2650 views
    This topic created in 2395 days ago, the information mentioned may be changed or developed.
    2 replies  •  2020-05-12 23:21:55 +08:00
    chairuosen
    chairuosen
    May 7, 2020
    1
    越少,因为高内聚
    钩子函数除外
    kwrush
    kwrush
    May 12, 2020
    2
    并没有绝对好坏把,取决于组件需不需要暴露很多 api 给外界调用,比如样式属性
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1777 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:54 · PVG 08:54 · LAX 16:54 · JFK 19:54
    ♥ Do have faith in what you're doing.