React.js: Stop render from scrolling to top of page

后端 未结 4 1456
眼角桃花
眼角桃花 2020-12-10 10:27

Every time you perform a render in React.js, the UI scrolls to the top of the page.

JSFiddle: http://jsfiddle.net/bengrunfeld/dcfy5xrd/

Any nifty or rea

4条回答
  •  萌比男神i
    2020-12-10 10:58

    If render trigger scrolling to the top it usually means some UI component is changing its dimension because of the state, this can be fixed by adding a minimum width/height

提交回复
热议问题