Using NodeJS to build an web app, I am using React
and Pug
together. I know that Pug is for rendering static content, and React
is responsible for rendering dynamic content. I have a page that needs both.
Think about the Instagram web page, it has some static content, but when user scroll down to the bottom, it will load more pictures.
I have a Pug
template, which in the end, I included the React
script like this:
block scripts
script(src="/component/design-grid.js" type="module")
And I want to trigger my react code by doing(This won't work):
script ReactDOM.render(<DesignGrid mainPage={true} category={"daily"} verified={false}/>, document.getElementById("grid-container"));
What's the standard way to accomplish something like this?