mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-16 00:50:18 -04:00
remove useimmutable demo from homepage
This commit is contained in:
parent
25e7c08605
commit
7acfa610cb
|
@ -3,7 +3,6 @@ import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
||||||
import GroupsProvider from '../state/GroupsProvider';
|
import GroupsProvider from '../state/GroupsProvider';
|
||||||
import NotificationsProvider from '../state/Notifications/NotificationsProvider';
|
import NotificationsProvider from '../state/Notifications/NotificationsProvider';
|
||||||
import { useMe } from './hooks';
|
import { useMe } from './hooks';
|
||||||
import useImmutable from './useImmutable';
|
|
||||||
import WheelShare from './WheelShare';
|
import WheelShare from './WheelShare';
|
||||||
import WheelShareLoggedOut from './WheelShareLoggedOut';
|
import WheelShareLoggedOut from './WheelShareLoggedOut';
|
||||||
|
|
||||||
|
@ -24,20 +23,12 @@ const style: CSSProperties = {
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const user = useMe();
|
const user = useMe();
|
||||||
const [imm] = useImmutable({
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
z: { a: 1, b: 2, c: [0, 1, 2] },
|
|
||||||
});
|
|
||||||
return (
|
return (
|
||||||
<NotificationsProvider>
|
<NotificationsProvider>
|
||||||
<GroupsProvider>
|
<GroupsProvider>
|
||||||
<div style={{ padding: '1rem', maxWidth: '100vw' }}>
|
<div style={{ padding: '1rem', maxWidth: '100vw' }}>
|
||||||
<div style={style}>
|
<div style={style}>
|
||||||
{JSON.stringify(imm)}
|
|
||||||
{/* Reset button */}
|
|
||||||
<button onClick={() => imm.z.a++}>Increment</button>
|
|
||||||
<button onClick={() => imm.z.c.push(imm.z.c.length)}>Push</button>
|
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
|
|
18
src/components/UseImmutableTest.tsx
Normal file
18
src/components/UseImmutableTest.tsx
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import useImmutable from './useImmutable';
|
||||||
|
|
||||||
|
export default function UseImmutableTest() {
|
||||||
|
const [imm] = useImmutable({
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: { a: 1, b: 2, c: [0, 1, 2] },
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{JSON.stringify(imm)}
|
||||||
|
Reset button
|
||||||
|
<button onClick={() => imm.z.a++}>Increment</button>
|
||||||
|
<button onClick={() => imm.z.c.push(imm.z.c.length)}>Push</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user