3

svelte/5/components-as-functions

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

In Svelte 3 and 4, components were classes, while in Svelte 5, components are functions. This codemod updates the instantiation of Svelte components to use mount or hydrate (imported from svelte), ensuring compatibility with Svelte 5's new functional component model.

Before

jsx

After

jsx

Ready to contribute?

Build your own codemod and share it with the community.