RandoML implementation for React
First, install the library in your project by npm:
$ npm install react-randoml
Or Yarn:
$ yarn add react-randoml
useRandoml
hook:
import React from 'react';
import { useRandoml } from 'react-randoml';
const App = () => {
const { choose } = useRandoml(/* object with options (if needed) */);
const randomValue = choose();
return <h1>{randomValue}</h1>;
};
export default App;
withRandoml
HOC:
import React from 'react';
import { withRandoml } from 'react-randoml';
const App = ({ choose }) => {
const randomValue = choose();
return <h1>{randomValue}</h1>;
};
export default withRandoml(/* object with options (if needed) */)(App);
This project is licensed under the MIT License © 2020-present Jakub Biesiada