I am very new to react and i had to use some lines of Jquery codes on most of the pages.
For now, i have written the code on componentDidmount()
, I have write this code on every other pages. That means, if i have to change something, i have to change it on all the other pages. What way would be better to put that code on a page and import that code on every page where its needed ?
This is the jquery code,
$(document).ready(function () {
var getOffset = "";
$('.table-responsive').on('scroll', function () {
getOffset = $('.table').position().top;
console.log(getOffset);
$('.radius-wrapper').css('top', getOffset + 48);
});
});