import React from "react"; import op from "object-path"; import config from "~/config"; import ky from "ky"; // const config = { // title: "Hello World", // description: "Hello World description", // }; const data = { title: "Hello World", description: "Hello World description", og: { title: config.title, description: config.description, image: "https://duogeeks.com/images/logo.png", }, }; const HelloWorld: React.FC = () => { const [state, setState] = React.useState([]); React.useEffect(() => { ky.get("https://jsonplaceholder.typicode.com/todos/") .json() .then((data) => { setState(data); }); }, []); return (
Hello World !

{data.description}

Name: {op.get(data, "og.title")}

TODO Data

); }; export default HelloWorld;