question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v3] Typescript needs to switch typings over to RN automatically

See original GitHub issue

Version

styled-components: 3.0.1 babel-plugin-styled-components: —

Reproduction

https://www.webpackbin.com/bins/-KeeZCr0xKfutOfOujxN https://codesandbox.io/s/rkmNRByE4

Steps to reproduce

After adopting new import for native i.e. omitting /native all types are missing for things like styled.Text, styled.ImageBackground etc…

Expected Behavior

These should exist in native on styled with new import.

Actual Behavior

import styled from "styled-components";

const Test = Styled.Text``;

[ts] Property 'Text' does not exist on type 'ThemedBaseStyledInterface<any>'. Did you mean 'text'?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
mxstbrcommented, Mar 16, 2018

You can still use styled-components/native in 3.x as a temporary fix for TypeScript.

2reactions
Igorbekcommented, Mar 16, 2018

@mxstbr is it possible to not deprecate styled-components/native until it’s sorted out?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not find a declaration file for module 'module-name ...
It only worked for me if I named the typings file index.d. · Also worked for me (didn't need to change the name...
Read more >
Documentation - Type Compatibility - TypeScript
Type compatibility in TypeScript is based on structural subtyping. Structural typing is a way of relating types based solely on their members.
Read more >
Configure TypeScript, TSLint, and Prettier in VS Code for ...
For this post we are going to start from a newly created project. You can skip ahead to the TypeScript setup if you're...
Read more >
If you don't use TypeScript, tell me why : r/javascript - Reddit
Given that TypeScript makes every attempt to align syntactically with the underlying language (almost verbatim), provides optional static typing ...
Read more >
How To Set Up a React Project with Create React App
In other words, you don't have to worry about configuring a build ... change to the CSS and the JavaScript code that will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found