![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@native-base/formik-ui
Advanced tools
Readme
@native-base/formik-ui is the official NativeBase - Formik bindings by NativeBase Team. @native-base/formik-ui
provides with form components integrated with formik hooks out of the box, Each component makes use of Formik's context, therefore you need to have Formik installed in your project, after that all you have to do is write your validationSchema
, build your Form using NativeBase Formik UI components and wrap that with <Formik/>
, rest will be taken care by us.
import React from 'react';
import {
CheckboxControl,
Text,
SubmitButton,
ResetButton,
Box,
ButtonGroup,
} from '@native-base/formik-ui';
import { Formik } from 'formik';
import { Heading, Center, NativeBaseProvider } from 'native-base';
import * as Yup from 'yup';
const validationSchema = Yup.object().shape({
tnc: Yup.boolean().equals([true], 'Terms and Condition must be checked !'),
newsletter: Yup.boolean(),
});
function FormikCheckboxBasicExample() {
const onSubmit = async (values) => {
await new Promise((resolve) => setTimeout(resolve, 1000));
console.log(values);
};
return (
<Formik
initialValues={{
tnc: true,
newsletter: false,
}}
onSubmit={onSubmit}
validationSchema={validationSchema}
>
{({ values, errors }) => (
<Box>
<Heading>Checkbox FormControl</Heading>
<CheckboxControl name="tnc" label="Checkbox Control Label" mt={4}>
<Text mx={2}>Terms and Conditions</Text>
</CheckboxControl>
<CheckboxControl name="newsletter" mt={4}>
<Text mx={2}>Subscribe to Our Newsletter</Text>
</CheckboxControl>
<Box pb={4} />
<ButtonGroup spacing={6}>
<SubmitButton colorScheme="teal">Next</SubmitButton>
<ResetButton colorScheme="yellow">Reset</ResetButton>
</ButtonGroup>
<Box mt={4} bg="gray.100" p={3}>
<Heading size="sm" mb={2}>
Current State
</Heading>
Values: {JSON.stringify(values, null, 2)}
Errors: {JSON.stringify(errors, null, 2)}
</Box>
</Box>
)}
</Formik>
);
}
export default function () {
return (
<NativeBaseProvider>
<Center flex={1}>
<FormikCheckboxBasicExample />
</Center>
</NativeBaseProvider>
);
}
# Using Yarn
yarn add @native-base/formik-ui
# Using NPM
npm i @native-base/formik-ui
NativeBase Formik UI has Formik, NativeBase and some various other libraries as Peer Dependencies. So make sure to have those packages installed to your project to make use of NativeBase Formik UI.
# Using Yarn
yarn add formik native-base@next react-native-svg @expo/vector-icons styled-components styled-system react-native-safe-area-context @react-native-picker/picker
# Using NPM
npm i formik native-base@next react-native-svg @expo/vector-icons styled-components styled-system react-native-safe-area-context @react-native-picker/picker
To validate the form fields, we recommend using Yup.
# Using Yarn
yarn add yup
# Using NPM
npm i yup
See the Contribution guide to learn how to contribute to the repository and the development workflow.
MIT © NativeBase
FAQs
NativeBase Formik Integration
The npm package @native-base/formik-ui receives a total of 102 weekly downloads. As such, @native-base/formik-ui popularity was classified as not popular.
We found that @native-base/formik-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.