2.0.0 ā¢ Published 4 months ago
vite-plugin-simple-scope v2.0.0
simple scope š
Get a scoped ID for whatever file you're in. Resolved at build-time with zero client JS.
import { scope } from 'simple:scope';
function Form() {
return (
<form>
<label htmlFor={scope('email')}>Email</label>
<input id={scope('email')} name="email" />
</form>
);
}
/*
Output:
<form>
<label for="email-dj23i_ka">Email</label>
<input id="email-dj23i_ka" name="email">
</form>
*/
š Visit the docs for more information