This codemod updates Svelte component rendering:
- Converts calls to
Component.render({...})
torender(Component, { props })
. - Ensures the import statement
import { render } from 'svelte/server'
is added if render is used.
Before
import App from './App.svelte';const { html, head } = App.render({ message: 'hello' });
After
import { render } from 'svelte/server';import App from './App.svelte';const { html, head } = render(App, {props: { message: 'hello' },});
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community