@magic-libraries/preventDefault
@magic-libraries/preventDefault
@magic-client library:@magic-libraries/preventDefault is an effect that calls event.preventDefault.
installation
@magic-libraries/prevent-default is preinstalled in all @magic apps.
For use in other hyperapp apps:
npm install --save-exact @magic-libraries/prevent-default
usage
in a page/component, just use the lib.preventDefault effect
<a
href="/somewhere/"
onclick="[actions.go, lib.preventDefault]">
</a>
<form
name="form-name"
onsubmit="[actions.form.submit, lib.preventDefault]">
</form>
source
the source for this page is in the example directory and gets built and published to github using @magic/core