https://github.com/mucahitdev/mutahit
React
https://github.com/mucahitdev/mutahit
Last synced: about 1 year ago
JSON representation
React
- Host: GitHub
- URL: https://github.com/mucahitdev/mutahit
- Owner: mucahitdev
- License: mit
- Created: 2022-10-21T10:24:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-21T12:49:27.000Z (over 3 years ago)
- Last Synced: 2025-04-18T04:56:21.230Z (about 1 year ago)
- Language: JavaScript
- Size: 379 KB
- Stars: 19
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mutahit
> React Custom Hooks
[](https://www.npmjs.com/package/mutahit) [](https://standardjs.com)
## Install
```bash
npm i mutahit
```
## or
```bash
yarn add mutahit
```
## Usage
```js
import React, { useState } from 'react'
import { useRandomColor, useNumberWithCommas, useConvertPrice } from 'mutahit'
const App = () => {
const [color, setRandomColor] = useRandomColor()
const [number, setNumber] = useState(0)
return (
Change Color
setNumber(e.target.value)}
/>
{useNumberWithCommas(number)}
{useConvertPrice(number, 'tr')}
)
}
export default App
```
## Hooks
```js
const [color, setRandomColor] = useRandomColor()
color type: string (#000000)
setRandomColor type: function (set random color)
```
```js
useNumberWithCommas(number)
number type: number required (100000)
```
```js
useConvertPrice(number, lang)
number type: number required (100000)
lang type: string optional default: 'en'
```
```
## License
MIT © [mucahitkok](https://github.com/mucahitkok)