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

Extract hooks to own ns, inline code viewer and let it use hooks #257

Merged
merged 16 commits into from
Nov 10, 2022

Conversation

zampino
Copy link
Collaborator

@zampino zampino commented Nov 2, 2022

  • inlines code viewer in render namespace
  • uses React hooks to embed codemirror into DOM

(def render-code code/viewer)

(defn render-code [value]
(let [ref (use-ref nil)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mhuebert is use-effect right choice here? Effect cleanup has the codemirror instance in scope in this way. Do you think there's a better way to do this?

@mk mk marked this pull request as ready for review November 10, 2022 14:12
@mk mk changed the title Hookify Code renderer Extract hooks to own ns, refactor render-code to be based on hooks Nov 10, 2022
@mk mk changed the title Extract hooks to own ns, refactor render-code to be based on hooks Extract hooks to own ns, inline code viewer and let it use hooks Nov 10, 2022
@zampino
Copy link
Collaborator Author

zampino commented Nov 10, 2022

This can be merged from my side, I think.

@zampino zampino merged commit 8f37676 into main Nov 10, 2022
@zampino zampino deleted the hookify-code-viewer branch November 10, 2022 17:08
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.

2 participants