https://github.com/bukinoshita/sanitize-styled-jsx
Sanitize React components using styled-jsx
https://github.com/bukinoshita/sanitize-styled-jsx
component css-in-js jest jsx react sanitize style styled styled-jsx
Last synced: about 1 month ago
JSON representation
Sanitize React components using styled-jsx
- Host: GitHub
- URL: https://github.com/bukinoshita/sanitize-styled-jsx
- Owner: bukinoshita
- License: mit
- Created: 2017-09-22T17:46:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-04T04:27:08.000Z (almost 6 years ago)
- Last Synced: 2025-02-28T07:51:14.300Z (about 2 months ago)
- Topics: component, css-in-js, jest, jsx, react, sanitize, style, styled, styled-jsx
- Language: JavaScript
- Homepage:
- Size: 54.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# sanitize-styled-jsx [](https://travis-ci.org/bukinoshita/sanitize-styled-jsx)
> Sanitize React components using [styled-jsx](https://github.com/zeit/styled-jsx)
## Install
```
$ yarn add --dev sanitize-styled-jsx
```## Usage
```js
// Testing with Jestimport React from 'react'
import assertEqualJSX from 'assert-equal-jsx'import Component from '../src/index'
import sanitize from 'sanitize-styled-jsx'describe('component', () => {
it('should create a correct DOM structure', () => {
const componentMock =Hello Bu!
assertEqualJSX(, componentMock, { sanitize })
})
})
```## API
### sanitize(input)
#### input
Type: `string`
RequiredString to be sanitized
## License
MIT © [Bu Kinoshita](https://bukinoshita.io)