Convert a multi line string into a single line string - great for classnames and more
npm install singleline-nextConvert a multiline string to a single line string
---
Install the dependency
npm install singleline --save-dev
``js
import singleline from 'singleline';
...
)}
>
Some output
// className="rrs__select-container rrs__select-container--multiselect rrs__is-desktop rrs__options-container--visible"
`
Passing second parameter in as true, removes spaces around the HTML tags but it still respects the spaces in the contents of the tags and attributes.
`js
import singleline from 'singleline';
var testMultilineHTMLString = singleline(
, true);
console.log(testMultilineHTMLString);
// '
``