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.

inject JSX helpers in options

See original GitHub issue
{
  jsxInject: `import React from 'react'`,
  loader: 'jsx', 
  ...
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
privatenumbercommented, Feb 25, 2021

Webpack has a built-in solution for this via ProvidePlugin.

1reaction
deleoniocommented, Mar 21, 2021

Hello together, that is not the same!

import {h, Fragment} from 'preact'; ?!

plugins: [
  new webpack.ProvidePlugin({
    '{h, Fragment}': 'preact'
  })
]

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two-way Binding Helpers - React
Overview. LinkedStateMixin is an easy way to express two-way binding with React. In React, data flows one way: from owner to child.
Read more >
React JSX: selecting "selected" on selected <select> option
The option values are passed in as props from JSON. However that triggers a syntax error on JSX compilation. Is there a recommended...
Read more >
Helper functions in the React useEffect hook | Ben Ilegbodu
Four options for dealing with helper functions listed as dependencies in the useEffect hook.
Read more >
babel/preset-react
With options: { "presets": [ [ "@babel/preset-react", { "pragma": "dom", // default pragma is React.createElement (only in classic runtime) "pragmaFrag": ...
Read more >
Compilation - SWC
You must add @swc/helpers as a dependency in addition to @swc/core . ... createElement instead - with this option, you must ensure that...
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