Bird
0
0

Given this Angular app with hydration enabled, what happens when the user clicks a button rendered by the server?

medium📝 component behavior Q4 of 15
Angular - Server-Side Rendering
Given this Angular app with hydration enabled, what happens when the user clicks a button rendered by the server?
bootstrapApplication(AppComponent, { hydration: true });
AThe click event triggers without re-rendering the button
BThe button is re-rendered and the click event is lost
CThe app reloads the entire page on click
DThe button does not respond to clicks
Step-by-Step Solution
Solution:
  1. Step 1: Understand hydration effect on events

    Hydration attaches event listeners to server-rendered HTML, so clicks work without re-rendering.
  2. Step 2: Evaluate other options

    Re-rendering or page reloads do not happen with hydration enabled; events are not lost.
  3. Final Answer:

    The click event triggers without re-rendering the button -> Option A
  4. Quick Check:

    Hydration keeps events active = True [OK]
Quick Trick: Hydration keeps server HTML interactive without re-render [OK]
Common Mistakes:
  • Assuming hydration causes re-render on event
  • Thinking hydration disables events
  • Believing hydration reloads the page on interaction

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes