Giter VIP home page Giter VIP logo

Comments (6)

erictraut avatar erictraut commented on May 17, 2024

Yes, it should work with both React and React Native. Let us know if you're having problems.

from resub.

dabit3 avatar dabit3 commented on May 17, 2024

I'm sure it's something completely dumb, but I'm getting the attached error.

App.tsx:

import { ComponentBase } from 'resub';

import React from 'react'
import { View, Text } from 'react-native'

import TodosStore = require('./TodosStore');

interface TodoListState {
    todos?: String[]
}

class TodoList extends ComponentBase<{}, TodoListState> {
    protected _buildState(props: {}, initialBuild: boolean): TodoListState {
        return {
            todos: TodosStore.getTodos()
        }
    }

    render() {
        return (
            <View>
               <Text>Hello
<img width="368" alt="screen shot 2017-04-28 at 11 54 11 am" src="https://cloud.githubusercontent.com/assets/1857282/25538781/a9fa2c3e-2c09-11e7-810c-c629dfee305a.png">
</Text>
            </View>
        );
    }
}

export = TodoList;

from resub.

dabit3 avatar dabit3 commented on May 17, 2024

screen shot 2017-04-28 at 11 54 11 am

from resub.

berickson1 avatar berickson1 commented on May 17, 2024

@dabit3 Can you share the complete stack please?

from resub.

berickson1 avatar berickson1 commented on May 17, 2024

Also what version of ReactNative are you using? RN 0.25.1 made some breaking changes that could be related to this error. I've only ever tested this using more recent versions or React Native See:
https://github.com/facebook/react-native/releases/tag/v0.25.1

from resub.

dabit3 avatar dabit3 commented on May 17, 2024

So, I was importing like this import React from 'react', but needed to do this:

import * as React from 'react'

I'm using commonjs in my compilerOptions -> module within my tsconfig.

I'll go ahead and close this, thanks for your help.

from resub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.