JavaScript Jabber cover image

Progressive Enhancement with Elliott Johnson - JSJ 591

JavaScript Jabber

CHAPTER

How to Render a Script Component

When you're rendering a spell component, you have your script tag. Your script tag is going to be run from top to bottom on the server. When it gets to the browser, it's then going to hydrate that component. And when it's mounted, it will run that on mount code. But we also have hooks on mount, on destroy, you know, lifecycle hooks. So if I write an on mount hook in my component, when it is run on the server, that on mount hook is not going to be running. Because there's no mount on the server,. You're not actually mounting anything to the DOM. You're just generating a string that's going to

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner