4leaf-hooks-useinput 中文文档教程
4leaf-hooks-useinput
React Hooks 实时改变输入值
installation
yarn
yarn add 4leaf-hooks-useinput
npm
npm install 4leaf-hooks-useinput
Usage
import React from "react";
import useInput from "4leaf-hooks-useinput";
const App = () => {
const formId = useInput(``);
// If you change the value
formId.setValue("New Value Here!");
return <form>
<div>
<label> ID </label>
<input type="text" {...formId}/>
</div>
<form>
;
}
Arguments
Argument | Type | Description | Required |
---|---|---|---|
String | String | Auto Setting Value and onChange with setValue | YES |
4leaf-hooks-useinput
React Hooks to realtime change input value
installation
yarn
yarn add 4leaf-hooks-useinput
npm
npm install 4leaf-hooks-useinput
Usage
import React from "react";
import useInput from "4leaf-hooks-useinput";
const App = () => {
const formId = useInput(``);
// If you change the value
formId.setValue("New Value Here!");
return <form>
<div>
<label> ID </label>
<input type="text" {...formId}/>
</div>
<form>
;
}
Arguments
Argument | Type | Description | Required |
---|---|---|---|
String | String | Auto Setting Value and onChange with setValue | YES |