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.

Whitespace in filename bug

See original GitHub issue
import Person_add_icon from '../../../../assets/images/icons/person add.svg'

Is converted into

function Person add (props) {

You should replace all whitespace string.replace(/\s/g, ''). And what if the filename starts, say, with a digit. Or contains a dot. You should just leave it as SVG.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jhamletcommented, Jun 28, 2017

@halt-hammerzeit Still thinking of changing to defaulting to SVGReactComponent if there is no name parameter given. This way I can forgo having to parse the fifteen million ways people want to name their files.

Another option is to allow for a function as the name parameter that receives the filename, and then individuals can customize if they really want to.

1reaction
jhamletcommented, Jun 28, 2017

@halt-hammerzeit Are you using the new titleCaseDelim parameter to specify your own delimiter (eg.: /\s+/g)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

I'm “still afraid to use spaces in file names” years old
Spaces are nuisances that bring no benefit. At best we should use non-breaking space for filenames, but that would be even more atrocious....
Read more >
Long filenames or paths with spaces require quotation marks
Solves an issue that occurs when you specify long filenames or paths with spaces.
Read more >
FILENAME gets white spaces wiped out at its end - Fixed Bugs
It seems that one of the latest changes made it impossible to create filenames with whitespace before the dot of the file extension....
Read more >
File not found. Empty spaces in filename workaround?
Hello,. I have a colleague who believes the reason why their users are having problems with accessing files because the files have spaces...
Read more >
Issue with filename containing spaces - php - Stack Overflow
There is a bug in an OpenCart Framework version 3.0.2.0,. If there are files with the filename containing spaces between them, ...
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