0

I am very new to react. I grabbed the petclinic project from github (https://github.com/spring-petclinic/spring-petclinic-reactjs) to run it and understand how react works. I want to add plugins to this project (plugins are other react projects as I understand), The plugin I want to add is a datatable (https://github.com/rishabhbits038/react-tabelify) which is another react project. My question is how to integrate one react project inside the other. in jquery it is direct, just including the .js file in the project but in react it does not seem that obvious.

2
  • There's some nuance to this, but typically you just npm install the component and import it wherever you want to use it. Commented Jan 22, 2018 at 15:25
  • I do npm install for the petclinic project then I want to import the other project into the first one, I can't npm install the second one because if I need to integrate more plugins I will nor npm install all of them to run my project. Commented Jan 22, 2018 at 15:27

1 Answer 1

1

From inside the petclinic project, run

npm install react-tabelify

and import the component you want use as:

import Tabelify from 'react-tabelify';

should work, as the second library is registered with npm

Sign up to request clarification or add additional context in comments.

9 Comments

missing string in import
I would suggest changing to npm install react-tabelify --save
I will try this solution and report in the comments. Thank you guys.
Thank you very much Dane:))
this is old question , but you can use this repository : github.com/nimahkh/react-all-in-one-package it helps me
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.