reactjs / reactjs/react.dev

Is this a good way to use dangerouslySetInnerHTML as it's used at the home page?

Open
#1,527 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Here is a part of the example used in React's home page:

https://github.com/reactjs/reactjs.org/blob/ea03fe7163c89b9e48565408f62c6ef805198467/content/home/examples/a-component-using-external-plugins.js#L12-L15

With this usage within the render function:

https://github.com/reactjs/reactjs.org/blob/ea03fe7163c89b9e48565408f62c6ef805198467/content/home/examples/a-component-using-external-plugins.js#L32

isn't a brand new Remarkable instance going to be created after each trigger of onChange event (which is every keystroke)? If so, is it okay to encourage this usage on the home page? If not, I'd love to hear why :)

Thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open content/home/examples/a-component-using-external-plugins.js at the referenced lines and trace how the Remarkable instance is used from render and the onChange flow. Confirm whether the example creates a new instance for each keystroke, then document the conclusion and identify whether the home-page example needs clarification or revision.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.