Package Exports
- react-slugify
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-slugify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-slugify
Slugify a React node.
Usage
slugify(node[, options])
node
String, Number, Fragment, Array of nodesoptions
Object (optional)delimiter
String (default is'-'
)prefix
String (default is''
)
Examples
import slugify from 'react-slugify';
slugify('something I want to test');
// -> "something-i-want-to-test"
slugify(<span>Yes it works like that too</span>);
// -> "yes-it-works-like-that-too"
slugify(
<>
<span>and</span>
<span>with</span>
<span>fragments or arrays</span>
</>
);
// -> "and-with-fragments-or-arrays"
slugify(<h3>Crème brulée receipe</h3>, { delimiter: '_' });
// -> creme_brulee_receipe
slugify(<h3>Crème brulée receipe</h3>, { prefix: 'user-content' });
// -> user-content-creme-brulee-receipe
slugify(<h3>Crème brulée receipe</h3>, {
delimiter: '_',
prefix: 'user-content',
});
// -> user-content_creme_brulee_receipe