DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Bret
Bret

Posted on

How do you connect c++ in a react project?

How do you connect a C++ file to React?

Top comments (8)

Collapse
 
hamiecod profile image
Hargunbeer Singh

Use C++ addons for node.js

P.S: You would get a better response in Stack Exchange or StackOverFlow :)

Collapse
 
yobretyo profile image
Bret Author

Thank you, I actually can’t stand Stack Overflow.... you mess up spelling, and they attack or even just a topic.... they get mad if you ask a NEW variation of a Question, that hasn’t been asked... and they get mad

Collapse
 
hamiecod profile image
Hargunbeer Singh

That's a shocking reality of StackOverFlow, which needs to change as people will only be comfortable asking questions if the community is chill(informal).

Collapse
 
tiagomelojuca profile image
Tiago Melo JucΓ‘

You have some options here:
1) Use the NodeJS nAPI to build a native module
2) Use a C++ application as backend for your React SPA
3) Use child_process (or something like ShellJS) to handle I/O of your C++ binary
4) Take a look at Web Assembly

Collapse
 
ats1999 profile image
Rahul kumar

Make a browser which can also parse c++.

Good luck

Collapse
 
zakiazfar profile image
Mohd Ahmad

through wasm

Collapse
 
shajidhasan profile image
Shajid Hasan

Run C++ in your backend/server. Communicate with it from your frontend with http requests.

In defense of the modern web

I expect I'll annoy everyone with this post: the anti-JavaScript crusaders, justly aghast at how much of the stuff we slather onto modern websites; the people arguing the web is a broken platform for interactive applications anyway and we should start over;

React users; the old guard with their artisanal JS and hand authored HTML; and Tom MacWright, someone I've admired from afar since I first became aware of his work on Mapbox many years ago. But I guess that's the price of having opinions.