An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

# sanitize-styled-jsx [![Build Status](https://travis-ci.org/bukinoshita/sanitize-styled-jsx.svg?branch=master)](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 Jest

import 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`

Required

String to be sanitized

## License

MIT © [Bu Kinoshita](https://bukinoshita.io)