Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itokun99/hooks
A collection of custom React hooks to simplify your development process.
https://github.com/itokun99/hooks
react react-hooks react-native reactjs
Last synced: about 2 months ago
JSON representation
A collection of custom React hooks to simplify your development process.
- Host: GitHub
- URL: https://github.com/itokun99/hooks
- Owner: itokun99
- Created: 2024-05-07T17:01:35.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T15:35:05.000Z (5 months ago)
- Last Synced: 2024-08-03T17:25:00.886Z (5 months ago)
- Topics: react, react-hooks, react-native, reactjs
- Language: TypeScript
- Homepage:
- Size: 90.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @itokun99/hooks
A collection of custom React hooks to simplify your development process.
## Installation
To install this package, run the following command:
```bash
npm install @itokun99/hooks
```## Usage
Here's how to use this package in your project.
### Importing Hooks
```javascript
import { useForm } from "@itokun99/hooks";
```### Example Hook Usage: `useForm`
Below is an example of how to use the `useForm` hook included in this package.
```javascript
import React from "react";
import { useForm } from "@itokun99/hooks";function ExampleForm() {
const { values, handleChange, handleSubmit } = useForm({
initialValues: { username: "", email: "" },
onSubmit: (formValues) => {
console.log("Form submitted with values:", formValues);
},
});return (
Username:
Email:
Submit
);
}export default ExampleForm;
```## Available Hooks
### `useForm`
A custom hook for managing form state and handling form submissions.
**Parameters:**
- `initialValues` (object): The initial values of the form fields.
- `onSubmit` (function): The function to call when the form is submitted.**Returns:**
- `values` (object): The current form values.
- `handleChange` (function): A function to handle input changes.
- `handleSubmit` (function): A function to handle form submission.### `useAnotherHook`
A description of what `useAnotherHook` does.
**Returns:**
- `value` (any): Some value.
- `setValue` (function): A function to update the value.## Contributing
If you would like to contribute to this project, please follow these steps:
1. Fork this repository.
2. Create a new feature branch (`git checkout -b new-feature`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin new-feature`).
5. Create a Pull Request.## License
This package is licensed under the [MIT License](LICENSE).
---
For more information, visit the [GitHub repository](https://github.com/itokun99/hooks).
```
Feel free to let me know if there are any additional changes you'd like to make!
```