Styled-components: react-native typescript styled_components_1.default.Text is not a function

Created on 21 Feb 2018  路  3Comments  路  Source: styled-components/styled-components

styled_components_1.default.Text is not a function

Version

styled-components: 3.1.6
typescript: 2.7.1

Steps to reproduce

Run a simple test

import 'react-native'
import * as React from 'react'
import App from '../App'
import * as renderer from 'react-test-renderer'

it('renders correctly', () => {
  const tree = renderer.create(
    <App />
  )
})

Expected Behavior

Test does not fail

Actual Behavior

    TypeError: styled_components_1.default.Text is not a function

      3 | import { palette } from 'styled-theme'
      4 |
    > 5 | export const SmallTextWrapper = styled.Text`
      6 |   font-size: 10px;
      7 | `
      8 |
duplicate needs more info

Most helpful comment

All 3 comments

Any idea @kitten? I'm not familiar with how the react native impl works.

Duplicate of #1495

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robbue picture robbue  路  3Comments

oscar-b picture oscar-b  路  3Comments

georgesboris picture georgesboris  路  3Comments

garmjs picture garmjs  路  3Comments

lazopm picture lazopm  路  3Comments