How to use the @emotion/styled-base.bind function in @emotion/styled-base

To help you get started, we’ve selected a few @emotion/styled-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emotion-js / emotion / packages / styled / src / index.js View on Github external
// @flow
import styled from '@emotion/styled-base'
import { tags } from './tags'

// bind it to avoid mutating the original function
const newStyled = styled.bind()

tags.forEach(tagName => {
  newStyled[tagName] = newStyled(tagName)
})

export default newStyled
github emotion-js / next / packages / styled / src / index.js View on Github external
// @flow
import styled from '@emotion/styled-base'

declare var codegen: { $call: Function, require: string => RegExp }

const tags = codegen`
const htmlTagNames = require('html-tag-names')
const svgTagNames = require('svg-tag-names')
module.exports = JSON.stringify(htmlTagNames
.concat(svgTagNames)
.filter((tag, index, array) => array.indexOf(tag) === index))
`

// bind it to avoid mutating the original function
const newStyled = styled.bind(undefined)

tags.forEach(tagName => {
  newStyled[tagName] = newStyled(tagName)
})

export default newStyled

@emotion/styled-base

Deprecated package which became `@emotion/styled/base`

MIT
Latest version published 4 years ago

Package Health Score

85 / 100
Full package analysis

Popular @emotion/styled-base functions

Similar packages