source: imaps-frontend/node_modules/react-use/esm/useDefault.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 317 bytes
Line 
1import { useState } from 'react';
2var useDefault = function (defaultValue, initialValue) {
3 var _a = useState(initialValue), value = _a[0], setValue = _a[1];
4 if (value === undefined || value === null) {
5 return [defaultValue, setValue];
6 }
7 return [value, setValue];
8};
9export default useDefault;
Note: See TracBrowser for help on using the repository browser.