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.

Import in create-react-app

See original GitHub issue

Is there a way to use this library with create-react-app ? The only way I was able to use it was including it in a script tag inside index.html and then inside of my component I had to use window.LeaderLine This seems very hacky

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
amostechcommented, May 22, 2020

Man, please rethink! We need this feature. It’s 2020. Have you changed your mind? If you do please publish a new npm version with this MAGIC ONE LINE!

if (module && module.exports) { module.exports = window.LeaderLine }

Do you think we should not use leader-line alongside with react due to compatibility issues?

2reactions
ansekicommented, May 23, 2020

Hi @amostech, thank you for the suggestion. I might rethink that someday. Thank you. 😄 BTW, you should use export default instead of module.exports.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing a Component | Create React App
You can configure your application to support importing modules using absolute paths. This can be done by configuring a jsconfig.json or ...
Read more >
Absolute imports in Create React App - DEV Community ‍ ‍
import useApi from 'hooks/use-api'; import Date from 'components/date'; import Image from 'components/image'; import transfromUserData from ' ...
Read more >
Code-Splitting - React
The best way to introduce code-splitting into your app is through the dynamic import() syntax. Before: import { add } from './math'; console ......
Read more >
Absolute Import in React | create-react-app - BezKoder
Absolute imports help to simplify the paths because the paths is now relative to the project root directory or custom base directory. With ......
Read more >
Making Life Easier with Absolute Imports - React in Javascript ...
According to create-react-app Docs, We can use absolute imports in our react project by configuring a jsconfig.json / tsconfig.json (for ...
Read more >

github_iconTop Related Medium Post

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