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-native-single-choice
Advanced tools
Readme
Single Choice component for React-native
Install the single-choice component with yarn add react-native-single-choice
or npm install react-native-single-choice --save
.
Import the component in your Javascript file
import React, { useState } from "react";
import { View, Text } from "react-native";
import SingleChoice from "react-native-single-choice";
const App = () => {
const securityMethodOptions = [
{
key: "faceId",
text: "Enable Face ID",
disabled: true
},
{
key: "pin",
text: "Set a pin"
},
{
key: "later",
text: "Set up later"
}
];
const roleOptions = [
{
key: "actor",
text: "Actor"
},
{
key: "director",
text: "Director"
}
];
const [securityMethod, setSecurityMethod] = useState({ method: "pin" });
const [role, setRole] = useState({ role: "actor" });
return (
<View style={{ flex: 1, marginTop: 40, marginLeft: 20 }}>
<Text>React Native Single Choice</Text>
<SingleChoice
options={securityMethodOptions}
defaultValue={securityMethod}
keyName='method'
selectDirection='column'
setValueFunc={setSecurityMethod}
/>
<SingleChoice
options={roleOptions}
defaultValue={role}
keyName='role'
selectDirection='row'
setValueFunc={setRole}
/>
</View>
);
};
export default App;
options
: list options. It's an array of objects. Set disabled to be true if you want disable that option.defaultValue
and keyName
are used to set the default selected option. Look the example to know how to set.selectDirection
: specifies the direction of the flexible items. (row
or column
).setValueFunc
: pass your set state function. It works with React Hooks.Of course! Welcome! I made this package from a simple component in project that I'm working. So welcome to any Pull Requests from you guys.
MIT
FAQs
Radio button component for react-native
The npm package react-native-single-choice receives a total of 28 weekly downloads. As such, react-native-single-choice popularity was classified as not popular.
We found that react-native-single-choice 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.