-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Description
We import #core/dom/jsx under the Preact namespace:
import * as Preact from '#core/dom/jsx';We should use @jsx with a namespace other than Preact since it's misleading:
#36640 (comment)
Nit: I'm a bit worried we'll confuse this with actual Preact (and the ability to diff). Can we use a different name and@jsxPragma?// input /** @jsx StaticTree.createElement */ <div/> // output StaticTree.createElement("div");
Closure does not play nice with the @jsx annotation:
WARNING - [JSC_BAD_JSDOC_ANNOTATION] Parse error. illegal use of unknown JSDoc tag "jsx"; ignoring it.
Place another character before the @ to stop JSCompiler from parsing it as an annotation.
If we ever figure this out, or move away from Closure (#35264), we should:
- Replace all uses with
JsxStaticTree - Update
local/preactlint rule so that it allows namespaces other thanPreact. (It would be convenient if namespace has to start withJsx)
Reactions are currently unavailable