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.

Use package octicons instead of including icons.tsx

See original GitHub issue

https://www.npmjs.com/package/octicons

Import as plain text:

import doma from 'doma';
import alertIcon from 'octicons/build/svg/alert.svg';

document.body.append(doma.one(alertIcon))

Or as JSX with https://github.com/janjakubnanista/svg-jsx-loader

import alert from 'octicons/build/svg/alert.svg';

document.body.append(alert());

There’s also the official @githubprimer/octicons-react package but I don’t think it’s being built+published correctly yet.

Also possibly: https://github.com/siddharthkp/jsxo but it needs Babel

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fregantecommented, Apr 3, 2019

Sadly they use too much React stuff in there, it’s bloated for us

0reactions
hardikmodhacommented, Apr 3, 2019

@bfred-it Seems like https://www.npmjs.com/package/@githubprimer/octicons-react is being published regularly now. Probably we can use it. What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use package octicons instead of including icons.tsx · Issue #1752 ...
Successfully merging a pull request may close this issue. Use @primer/octicons package instead of curating icons.tsx refined-github/refined-github.
Read more >
Use package octicons instead of including icons.tsx #1752 - Issuehunt
Use package octicons instead of including icons.tsx #1752 ... import doma from 'doma'; import alertIcon from 'octicons/build/svg/alert.svg'; ...
Read more >
How to Use SVG Icons in React with React Icons and Font ...
We're first going to walk through using a package called react-icons that will allow us to easily import icons from popular icon sets...
Read more >
extended-react-icons - npm
Include popular icons in your React projects easly with react-icons , which utilizes ES6 imports that allows you to include only the icons...
Read more >
JavaScript | Octicons - Primer Design System
This package is distributed with npm. After installing npm, you can ... Instead, use bracket notation (e.g. octicons['arrow-right'] ).
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