arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

MagicForm | <magic-form>

captures the submit event of the nested form and sends it to MagicFormProvider

hashtag
Examples

<MagicForm>
  <form action="user
<MagicForm onChangeState={event=>{
  console.

hashtag
Events

Type
Description
Config

hashtag
Properties

Property
Description
Type

hashtag
Property.state

"
>
<input type="text" name="name" />
<input type="text" name="email" />
<button>Create user</button>
</form>
</MagicForm>
log
(
event
.
currentTarget
.
state
);
}}>
<form action="user">
<input type="text" name="name" />
<input type="text" name="email" />
<button>Create user</button>
</form>
</MagicForm>

"ChangeState"

Dispatched when status changes from provider

{bubbles: false, composed: false}

state

Read only, Current status submission of the form

Object

action

Defines the action to dispatch, if not defined it can be inherited from the

tag

String

interface MagicFormActionStatus{
    result?:any,
    timestamp?: number,
    status: "pending" | "fulfilled" | "rejected"
}