node-ts3sdk-client icon indicating copy to clipboard operation
node-ts3sdk-client copied to clipboard

Addon usage in React

Open Skagoo opened this issue 6 years ago • 2 comments

Hi, first of all I highly appreciate that you made it possible to use the TS3Sdk in JS.

I've used your plugin successfully in a project of mine, made in electron. I've now moved to React and wanted do do a huge rework on my project, using React instead.

However I can't seem to figure out on how to get the addon working. I tried both with npm and by cloning the repo, building it (with npm install) and then include it in my project's src. Referencing the module with var ts3client = require('../api.js'); throws no errors but ts3client.initClientLib(ts3client.LogTypes.CONSOLE, undefined, ts3client.getResourcePath()); states that LogTypes is undefined.

Looking forward to your response.

Skagoo avatar Jun 28 '19 12:06 Skagoo

Hi, I find this issues from https://stackoverflow.com/questions/57061352/how-to-use-a-native-node-js-addon-in-react. So, have you got the sulution? Thanks.

befovy avatar Oct 27 '19 04:10 befovy

I have found a solution to use node C++ addon in React & Electron. You can see it from this commit https://github.com/befovy/node-addon-starter/commit/b841f0dbc4e0a35461aa3ed9fa09ab8aef22f564

befovy avatar Oct 29 '19 01:10 befovy