sanitize-styled-jsx
v0.0.2
Published
Sanitize React components using styled-jsx
Downloads
9
Maintainers
Readme
sanitize-styled-jsx
Sanitize React components using styled-jsx
Install
$ yarn add --dev sanitize-styled-jsx
Usage
// 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 = <h1>Hello Bu!</h1>
assertEqualJSX(<Component name="Bu" />, componentMock, { sanitize })
})
})
API
sanitize(input)
input
Type: string
Required
String to be sanitized
License
MIT © Bu Kinoshita