Comments (6)
Yes, it should work with both React and React Native. Let us know if you're having problems.
from resub.
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.
from resub.
@dabit3 Can you share the complete stack please?
from resub.
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.
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)
- ComponentBase HOT 4
- _buildState called on unmounted component HOT 3
- Proposal: Automatic Release HOT 1
- Non Singleton Usage of Store breaks the subscription keys HOT 1
- Discussion: Any examples on stores subscribing to other stores? HOT 2
- ReSub v2 setState not working? HOT 19
- Types Error in AutoSubscribe.spec.tsx
- Compatibility with Preact HOT 1
- Problem with _buildState + componentDidMount in same component HOT 3
- List ReSub extensions in README HOT 1
- React 18+ in StrictMode: _buildState is not triggered on state change HOT 9
- This repo is missing important files
- React 17 / state of maintenance HOT 3
- ComponentBase: Consider setState(updater) instead of setState(object)
- ComponentBase: Prevent _buildState re-entry HOT 3
- Avoid using lodash.bind as it calls Function#toString
- [discussion] Update ReSub to support the latest React HOT 20
- assert/production
- [discussion] ReSub Hook API HOT 6
- Compiler error using @key decorator HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resub.