nha
nha

Reputation: 18005

React.js insert script tag from remote CDN

I would like to insert scripts into the header of my page (or at least they have to be loaded before the render method of my component is called).

The scripts in question are from here if it matters :

<!-- jQuery -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script>

<!-- Firebase -->
<script src='https://cdn.firebase.com/js/client/2.0.2/firebase.js'></script>

<!-- Firechat -->
<link rel='stylesheet' href='https://cdn.firebase.com/libs/firechat/2.0.1/firechat.min.css' />
<script src='https://cdn.firebase.com/libs/firechat/2.0.1/firechat.min.js'></script>

Upvotes: 3

Views: 761

Answers (1)

Monstrum
Monstrum

Reputation: 88

Note: I would rather comment this but I do not possess 50+ reputation.


You can place your scripts in your index.html file before you load your react bundle.

Upvotes: 2

Related Questions