Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-use-inputs
Advanced tools
Changelog
1.1.0 (2020-04-20)
Readme
Set of hooks to manage your inputs.
yarn add react-use-inputs
# or
npm i react-use-inputs
import { useCheckbox } from 'react-use-inputs'
() => {
const checkbox = useCheckbox({ state: true });
return <input {...checkbox}>;
}
const checkbox = useCheckbox({ state: true });
const value = checkbox.checked;
const checkbox = useCheckbox({ state: true });
return (
<>
<input {...checkbox}>
<button type="button" onClick={checkbox.onChange}>Trigger</button>
</>
);
useCheckbox({
state: boolean;
disabled?: boolean = false;
id?: string;
name?: string;
})
import { useRadio, RadioGroup } from "react-use-inputs";
() => {
const radio = useRadio({ state: "B", name: "test" });
return (
<RadioGroup {...radio}>
<label htmlFor="A">A</label>
<input value="A" id="A" />
<label htmlFor="B">B</label>
<input value="B" id="B" />
</RadioGroup>
);
};
const radio = useRadio({ state: "B", name: "test" });
const value = radio.value;
const radio = useRadio({ state: "B", name: "test" });
return (
<>
<RadioGroup {...radio}>
<label htmlFor="A">A</label>
<input value="A" id="A" />
<label htmlFor="B">B</label>
<input value="B" id="B" />
</RadioGroup>
<button type="button" onClick={() => radio.onChange("B")}>
Reset value to "B"
</button>
</>
);
useRadio({
state: string;
name: string;
})
import { useSelect } from "react-use-inputs";
() => {
const select = useSelect({ state: "A" });
return (
<select {...select}>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
);
};
const select = useSelect({ state: "A" });
const value = select.value;
const select = useSelect({ state: "A" });
return (
<>
<select {...select}>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
<button type="button" onClick={() => select.onChange("B")}>
Reset value to "B"
</button>
</>
);
useSelect({
state: string;
id?: string;
name?: string;
disabled?: boolean = false;
})
import { useTextInput } from "react-use-inputs";
() => {
const textInput = useTextInput({ state: "" });
return <input {...textInput} />;
};
const textInput = useTextInput({ state: "" });
const value = textInput.value;
const textInput = useTextInput({ state: "" });
return (
<>
<input {...textInput} />
<button type="button" onClick={() => textInput.onChange("")}>
Reset
</button>
</>
);
useTextInput({
state: string;
type?: string = 'text';
disabled?: boolean = false;
id?: string;
name?: string;
placeholder?: string;
})
MIT
FAQs
Set of hooks to manage your inputs.
The npm package react-use-inputs receives a total of 0 weekly downloads. As such, react-use-inputs popularity was classified as not popular.
We found that react-use-inputs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.