Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: load html from file #1

Open
Gys opened this issue Dec 22, 2022 · 0 comments
Open

Suggestion: load html from file #1

Gys opened this issue Dec 22, 2022 · 0 comments

Comments

@Gys
Copy link

Gys commented Dec 22, 2022

One thing I dislike about React&Co is the integration of the html into the code. Can it be separated? So I can work on the html visually for layout and design. Ideally loading the contents of the return statement from a html file instead of integrating it into the code:

  export default function Home(props) {
      const [data, setData] = useState(props.data);
      useEffect(() => {
          fetch("http://localhost:8000/handler")
              .then(x => x.json())
              .then(x => setData(x));
      }, [])
      return (
        // insert contents of index.html
      )
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant