Skip to content

Conversation

JordanMartinez
Copy link
Contributor

Description of the change

Fixes #283. Also allows updates the frame.html file to include a <div id="root"></div>. See JordanMartinez/purescript-cookbook#198


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0 by @)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

</head>
<body>
<main id="main"></main>
<div id="root"></div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally following why this is required. Is the cookbook unable to use main id="main"? If not, and it seems important that we specifically use <div id="root">, then can we adjust the existing code (ie. the TryPureScript rendering) to point at this div and remove <main id="main">? It's a bit odd to have both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main is used to redirect Console.log (when under a TryPureScript.render =<< TryPureScript.withConsole, so that the strings logged to the console are instead added as nodes under the main id="main" HTML element rather than logging to the web browser's console.

I don't want the two to mix, so I'm creating a separate element for React usage.

@JordanMartinez JordanMartinez merged commit 5c7c1f0 into purescript:master Jul 15, 2022
@JordanMartinez JordanMartinez deleted the jam/use-div-root branch July 15, 2022 12:55
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

Successfully merging this pull request may close these issues.

How to deal with warnings in examples?
2 participants