I'm using create-react-app boilerplate and implementing an admin theme for the layout. In index.html file, there is a script import from the theme asset like this:

    You need to enable JavaScript to run this app.
  <div id="root"></div>
  <script src="%PUBLIC_URL%/assets/global/scripts/app.min.js" type="text/javascript"></script>

Inside that script, there's a global javascript object named App to manipulate the UI. And now, I want to call that object in my React code:

export const alertMessage = (options = {}) => {
  const defaultOption = {
    type: 'info',
    message: 'message',
    closeInSeconds: 5

  if (ALERT_TYPE_CORRECT[options.type] != null)
    options.type = ALERT_TYPE_CORRECT[options.type];

  options.icon = DEFAULT_ALERT_ICON_MAP[options.type];

  App.alert(Object.assign(defaultOption, options)); // here


Line 25:3:  'App' is not defined  no-undef

How to make this works? Should I access it with window.App?