0

I've been given an external API from a team member i'm working with on a ReactJS project. The file looks like this https://dev.wavemakerfutureproof.co.uk/futureproof-sdk.js

I wondered what the best approach was to utilise all of the methods this API provides as i assume this doesn't work like most things included in a ReactJS project. I.e. Import '...' from '...'

Any help is much appreciated!

2

2 Answers 2

1

It depends if you are using create-react-app to develop your React application, put your script in your index.html or entry html for your application:

<script src ="https://dev.wavemakerfutureproof.co.uk/futureproof-sdk.js" ></script>

There is a github issue for this, please go through below URL for more details:

https://github.com/facebook/create-react-app/issues/3007

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

Comments

1

u can import JSFile from Template html,like this

<html>
<script src ="https://dev.wavemakerfutureproof.co.uk/futureproof-sdk.js" ></script>
</html>

1 Comment

Okay, and can you just use the methods from the file like you would with say Jquery? and is it important what kind of html it is included in? does it have to be a template file or can it just be included in the index.html file?

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.