import React from "react"; import { Outlet, Link } from "react-router-dom"; import Button from "./Button"; export default function Layout ({userData}) { console.log(userData); //const [userData, setUserData] = useState({ name: "" }); // if the user tries to access the isolated domain then we redirect them // this is NOT done for security, only for good UX // rails serves the react app no matter what // so the app would be broken when served on the isolated domain const domain = window.location.host; console.log(domain); if(domain === "localhost:3000") { window.location.replace("http://127.0.0.1:3000"); } return ( <>