Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sanitize-styled-jsx

bukinoshita6MIT0.0.2

Sanitize React components using styled-jsx

jest, sanitize, styled-jsx, jsx, style, styled, react, component, css-in-js

readme

sanitize-styled-jsx Build Status

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