Using Core Node JS Modules in React Native Appsby@aakashns
26,890 reads
26,890 reads

Using Core Node JS Modules in React Native Apps

by Aakash N S3mJuly 2nd, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

React Native can’t package core Node JS modules into React Native, so you get a runtime error. This makes core modules like crypto modules like that of the Node JS binary unusable from React Native. Fortunately, there’s a solution to this problem, but it takes some work. There is a hacky but simple way to fix this problem with React Native: create a standalone Javascript file that contains a polyfill for themodule and use it within our app. The last few lines of the file contain our code from the polyfills.

Company Mentioned

Mention Thumbnail
featured image - Using Core Node JS Modules in React Native Apps
Aakash N S HackerNoon profile picture
Aakash N S

Aakash N S

@aakashns

Share Your Thoughts

About Author

Aakash N S HackerNoon profile picture
Aakash N S@aakashns

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!