Open threepointone opened 7 years ago
much like @initial, but functions corresponding to each will be fed into the component as props, and the component will be expected to call them. example -
@initial
@post(async ({ username, password }) => { return await require('./auth').validate(username, password) }) export class Login extends Component{ render(){ let { action, post, posting, posted, response, error, next } = this.props return posted ? <form onSubmit={post} action={action}> <input name='username'/> <input name='password'/> </form> : posting ? <span>checking ...</span> : response ? <Redirect to={next}/> : <div> login failed! {error} </div> } }
much like
@initial
, but functions corresponding to each will be fed into the component as props, and the component will be expected to call them. example -