Support react-native
See original GitHub issueI am going through the tutorial and I hit an error when I try to connect to the local websocket server from my React Native app. The error is:
Error: Buffer is not defined
stack:
Function.<anonymous> index.ios.bundle:64324
Function.module.exports.varar [as expr] index.ios.bundle:58951
Table.<anonymous> index.ios.bundle:61785
Table.RDBOp [as constructor] index.ios.bundle:61791
new index.ios.bundle:62148
Function.<anonymous> index.ios.bundle:64402
Function.module.exports.aropt [as table] index.ios.bundle:58972
React.createClass.componentDidMount index.ios.bundle:1493
CallbackQueue.assign.notifyAll index.ios.bundle:6674
ReactNativeReconcileTransaction.ON_DOM_READY_QUEUEING.close index.ios.bundle:16780
ReactNativeReconcileTransaction.Mixin.closeAll index.ios.bundle:7214
ReactNativeReconcileTransaction.Mixin.perform index.ios.bundle:7155
batchedMountComponentIntoNode index.ios.bundle:7516
Object.ReactDefaultBatchingStrategy.batchedUpdates index.ios.bundle:16560
Object.batchedUpdates index.ios.bundle:6444
Object.ReactNativeMount.renderComponent index.ios.bundle:7600
URL: undefined
line: undefined
message: Buffer is not defined
Some relevant code:
var ReactRethinkdb = require('react-rethinkdb');
var r = ReactRethinkdb.r;
//...
ReactRethinkdb.DefaultSession.connect({
host: 'localhost',
port: 8015,
path: '/db',
secure: false,
db: 'test',
});
//...
console.log(r.table('turtles'));
Issue Analytics
- State:
- Created 8 years ago
- Comments:49 (20 by maintainers)
Top Results From Across the Web
Where to get help
If you need help with your React Native app, the right place to go depends on the type of help that you need....
Read more >Where To Get Support
Where To Get Support. React has a community of millions of developers. On this page we've listed some React-related communities that you can...
Read more >React Native Support
React Native Support ... Meta's React Native and Developer Tooling teams work in close collaboration to ensure Flipper offers top-notch out-of-the-box value for ......
Read more >React Native Experts to Help, Mentor, Review Code & More
Find a freelance React Native expert for help with reviewing code, mentorship, tutoring, and other React Native help you might need.
Read more >What Is React Native? Complex Guide for 2022
React Native is a name you hear a lot in the mobile app development world. ... it up with Android support, before taking...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 Just got in. I believe it is really an excited feature for react native and rethinkdb!
I actually just tried to do this yesterday. I should have posted something about it. Try running this:
And then add this to the top of the first javascript file you run (like index.ios.js):
Also, I think you’ll need to
require('react-rethinkdb/dist/node')
instead ofrequire('react-rethinkdb')
since it’s not running in a browser environment.However, after I did all that, I ran into errors about some unknown
http
module, and didn’t have enough time to resolve that yet. Let me know if you run into the same thing, or something else first, or find a way around it.