DEV Community

Discussion on: Futuristic Infinite Scrolling in React and JavaScript

vetras profile image

What I usually see when we have DOM elements we want to show or hide dynamically is to have a display property on them (not just shove them outside the view 🙏 ).

For example:

  • on vue.js:
<p v-if=isLoading > loading... please wait </p>
Enter fullscreen mode Exit fullscreen mode
  • on react:
render() {
  return this.isLoading && (<p>loading ... please wait</p>);
Enter fullscreen mode Exit fullscreen mode

(full stack dev here, FYI, so my FE well...)

Thread Thread
dhairyanadapara profile image
Dhairya Nadapara Author

Oh yes, I completely missed this. Let me think of this how it will be achieved as target element is required to pass the in observe method.