This commit is contained in:
2021-06-12 17:48:26 +03:00
commit 3e68914c92
56 changed files with 26153 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import React, {memo} from 'react';
import {changeNameAction, nameAtom} from '_infrastructure/atom/exampleAtom';
import {useAction, useAtom} from '@reatom/react';
const MainPage: React.FC = () => {
const name = useAtom(nameAtom);
const handleChangeName = useAction(e => changeNameAction(e.currentTarget.value));
return (
<div>
<div>main page</div>
<form>
<label htmlFor="name">Enter your name: </label>
<input id="name" value={name} onChange={handleChangeName} />
</form>
</div>
);
};
export default memo(MainPage);