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.

Typescript section and React Native

See original GitHub issue

Related to https://www.styled-components.com/docs/api#typescript

The next code snipper wouldn’t work for react-native

// styled-components.ts

// notice that I actually import styledComponents from native (not the web one)
import * as styledComponents from 'styled-components/native';
import { ThemedStyledComponentsModule } from 'styled-components';

import ThemeInterface from './theme';

const {
  default: styled,
  css,
  injectGlobal,
  keyframes, // this does not exists on native
  ThemeProvider
} = styledComponents as ThemedStyledComponentsModule<ThemeInterface>;

export { css, injectGlobal, keyframes, ThemeProvider };
export default styled;

because I actually use styled-components/native I can’t use the code snippet.

Looking into the code this will require to fix the typespec for ThemedStyledComponentsModule of the native version

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
durocommented, Apr 11, 2018

@swissmanu Any update on where things stand with TypeScript support and react-native?

2reactions
probablyupcommented, Jan 10, 2019

Make a request on definitelytyped! On Thu, Jan 10, 2019 at 12:53 PM Bernardo Sunderhus < notifications@github.com> wrote:

Is this still an unsolved thing? I’m trying to use styled-components/native but there’s no typings for it

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/styled-components/styled-components-website/issues/216#issuecomment-453210796, or mute the thread https://github.com/notifications/unsubscribe-auth/AAiy1rMSEfvtDVT3opMQpKlfuaZx7_sKks5vB4wpgaJpZM4Rcwms .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using TypeScript - React Native
TypeScript is a language which extends JavaScript by adding type definitions, much like Flow. While React Native is built in Flow, ...
Read more >
How to Run React Native Apps with Typescript - Section.io
This tutorial will guide the reader on how to set up and run React Native apps with TypeScript.
Read more >
Using TypeScript with React Native - LogRocket Blog
An introduction to using TypeScript in React Native apps, including a tutorial and example build for a mobile app.
Read more >
React-Native with Typescript. Part 1 - Medium
Adding Typescript to a react-native project - Template options. Both Expo and React-Native CLI provide templates to have your app project ...
Read more >
Should we use TypeScript with React Native ? - GeeksforGeeks
Should we use TypeScript with React Native ? · TypeScript is basically JavaScript under the hood. Typescript adopts the basic building blocks of ......
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