2023-05-07 16:19:11 -04:00
|
|
|
import React from "react";
|
|
|
|
import * as Iso from "@eno/iso";
|
|
|
|
|
|
|
|
export default ()=>
|
|
|
|
{
|
|
|
|
const [countGet, countSet] = React.useState(1);
|
|
|
|
const [routeGet, routeSet] = Iso.Router.Consumer();
|
|
|
|
|
|
|
|
type CatFact = {fact:string, length:number}|undefined;
|
|
|
|
const [Data, Updating] = Iso.Fetch.Use(`https://catfact.ninja/fact`);
|
|
|
|
|
|
|
|
return <div class="p-4 text-red-500">
|
2023-05-15 07:26:18 -04:00
|
|
|
<Iso.Meta.Metas title="Cat Fact!"/>
|
2023-05-07 16:19:11 -04:00
|
|
|
Component Route is: {routeGet.Path.toString()}
|
|
|
|
<button className="p-4 bg-green-500 text-white" onClick={e=>{countSet(countGet+1); routeSet(["lol", "idk"], {count:countGet+1});}}>{countGet}</button>
|
|
|
|
<a href="/page/about-us" className="p-2 text(lg blue-500) font-bold">a link</a>
|
|
|
|
<p>Data:{Data && (Data as CatFact)?.fact}</p>
|
|
|
|
<p>Status:{Updating?'loading':'done'}</p>
|
|
|
|
</div>;
|
|
|
|
};
|