#Render new layout on page

8 messages · Page 1 of 1 (latest)

regal ivy
#

Explanation - All help will be welcome

How could I make a function render a new page by clicking a button?
Example? Clicking a "collect reward" button in the /prize route renders a new page layout in the same /prize route
Like the post method in express... Can anyone help me?

#

Like the discord bots that use /daily to redeem rewards and when collecting the page is changed showing the value of rewards acquired

rose pawn
#

that sounds like you want to render a different component depending on a specific state (which is changed on button click), not a page change

#

so a conditional rendering will suffice to do what you want

regal ivy
#

I want to replace the page components with new ones, and thus "render the page layout"

regal ivy
#

@rose pawn

dense briar
#

conditional rendering works for this, the conditions will define what components you want to render

regal ivy