In React, I have a wrapper that populates the isScrolled --- When the page loads isScrolled is false, when the user scrolls, isScrolled is equal to true.
In one of my React components, I have have the following:
<Button.Secondary
size="S"
onClick={() => {
// lots of stuff here
}}
>
{!isLoggedIn ? 'XXXXX' : 'YYYY'}
</Button.Secondary>
The challenge I'm having is when isScrolled is false, I want the above Button.Secondary - When isScrolled is true, I want:
<Button.Secondary
size="S"
onClick={() => {
// lots of stuff here
}}
>
{!isLoggedIn ? 'XXXXX' : 'YYYY'}
</Button.Secondary>
How can I make the Button._____ dynamic based on the isScrolled property?