Passing script variable as props to root component (Reactjs)


#1

Hi, this is my first time posting here, and I’m quite new to react.js and meteor.js.

Currently, I have a few script tags in my main.html file. I’m trying to pass one of the variables to the root component of my application as props in the main.jsx file.

I’m unable to do this currently because I’m unable to obtain a reference of the variable in my main.jsx file.
Is there an example to show how this can be implemented?

Thank you very much!


#2

As in you added these, rather than you’ve looked in web inspector and seen a lot of script tags?

Generally speaking adding script tags is unnecessary (and as you’ve found) it sometimes doesn’t work quite as you expect.

Perhaps you could tell us what you’re trying to do?