question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

createElement setting?

See original GitHub issue

We allow createClass to be overridden with a setting - should we allow createElement to be configured as well?

If so, any rules referencing React.createElement should be sure to use <pragma>.<createElement>

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jkremscommented, Nov 13, 2017

Would it make sense to also allow h(...) as an alternative to React.createElement(...)? It’s a relatively common pattern exposed by preact.

1reaction
TrySoundcommented, Feb 27, 2017

This works for me

settings:
  react:
    pragma: 'createElement'

rules:
  no-unused-vars: 'error'
  react/jsx-uses-react: 'error'
  react/jsx-uses-vars: 'error'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Document.createElement() - Web APIs | MDN
createElement () method creates the HTML element specified by tagName, or an HTMLUnknownElement if tagName isn't recognized.
Read more >
HTML DOM Document createElement() Method - W3Schools
HTML DOM Document createElement() ... The createElement() method creates an element node. ... createElement() is a DOM Level 1 (1998) feature.
Read more >
JavaScript document.createElement() By Practical Examples
In this tutorial, you will learn how to use the JavaScript document.createElement() to create a new HTML element and attach it to the...
Read more >
Javascript function document.createElement(tagName ...
I get that this is an ancient question (relatively), and @Luke-Weaver's answer already gave a route involving jQuery, but the following is an...
Read more >
How to createElement in JavaScript? - CodeBrainer
createElement method creates a new HTML element within DOM. When calling the method, you have to provide a tag name that defines the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found