Check out example codes for "datatables when filtering snaps to top of page". It will help you in understanding the concepts better.

Code Example 1

Plain text123456"preDrawCallback": function (settings) {    pageScrollPos = $('body').scrollTop();},"drawCallback": function (settings) {    $('body').scrollTop(pageScrollPos);},

Learn ReactJs, React Native from akashmittal.com