Both React and ReactDOM are available over a CDN.

<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
The versions above are only meant for development, and are not suitable for production. Minified and optimized production versions of React are available at:

<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
If you serve React from a CDN, we recommend to keep the crossorigin attribute set:

<script crossorigin src="..."></script>

I think I found the issue and though it'd be OK to post my answer on stackoverflow to help others if anyone ever faces the same problem. I was putting the react-plaid-link inside the tags. The react-plaid-link returns a button which according to the html standard a button inside a form without "type" attribute acts like a submit button. Same goes here in my case which I click the the button it submit the form which causes refreshing page. I fixed the issue by just removing the tags. My updated code looks like this.


import React, {Component} from 'react';
import BuggyApi from "../../services/BuggyApi";
import BlockUi from "react-block-ui";
import ReactPlaid from 'react-plaid'

class Integration extends Component{
state={
    plaid_public_key: "",
    plaid_public_token: "",
    blocking: false,
    isSuccess: false,
    errorMessage: [],
    open: false,
    plaidData: [],
};

componentWillMount(){
    new BuggyApi().getPlaidPublicKey().then((response)=>{
        console.log(response.data);
        if(response.status===200){
            this.setState({
                plaid_public_key: response.data.public_key
            });
        }
    }).catch((error)=>{

    })
}


handleOnExit = (error, metadata)=>{
    if (error != null) {
        console.log('link: user exited');
        console.log(error, metadata);
    }
};
handleOnLoad =()=>{
    console.log('link: loaded');
};
handleOnEvent =(eventname, metadata)=>{
    console.log('link: user event', eventname, metadata);

};
handleOnSuccess = (public_token, metadata) => {
    console.log('public_token: ' + public_token);
    console.log('account ID: ' + metadata.account_id);
};
componentDidMount(){
    const script = document.createElement("script");
    script.src = "https://cdn.plaid.com/link/v2/stable/link-initialize.js";
    script.async = true;
    document.body.appendChild(script);
}



render(){
    return(
        <div className="page-wrapper">
            <div className="content container-fluid">
                <div className="row">
                    <div className="col-xs-8">
                        <h4 className="page-title">Integration</h4>
                    </div>
                    <div className="col-xs-4 text-right m-b-30">

                    </div>
                </div>
                <div className="row">
                    <div className="col-md-12">
                        <div className="text-center">
                            <h4 className="modal-title">
                                Link your bank account
                            </h4>
                        </div>
                        <br/>
                        <br/>
                            {(this.state.isSuccess)?
                                <div className="row">
                                    <div className="col-sm-6 col-sm-offset-3">
                                        <div className="alert alert-success">
                                            <strong>Success!</strong> Settings updated successfully!
                                        </div>
                                    </div>
                                </div>:null
                            }
                            {(this.state.errorMessage.length>0)?
                                <div className="row">
                                    <div className="col-sm-6 col-sm-offset-3">
                                        <div className="alert alert-danger">
                                            <ul>
                                                {this.state.errorMessage.map((message,i) =><li key={i}>{message}</li>)}
                                            </ul>
                                        </div>
                                    </div>
                                </div>:null
                            }
                            <BlockUi tag="div" blocking={this.state.blocking}>
                                <div className="row">
                                    <div className="col-sm-6 col-sm-offset-3">
                                        {(this.state.plaid_public_key!=="")?
                                            <div>
                                                <button onClick={() => this.setState({ open: true})}>Open Plaid</button>
                                                <ReactPlaid
                                                    clientName="Arshad"
                                                    product={["auth"]}
                                                    apiKey={this.state.plaid_public_key}
                                                    env='sandbox'
                                                    open={this.state.open}
                                                    onSuccess={(token, metaData) => this.setState({plaidData: metaData})}
                                                    onExit={() => this.setState({open: false})}
                                                />
                                            </div>:null
                                        }
                                    </div>
                                </div>

                            </BlockUi>
                    </div>
                </div>
            </div>
        </div>
    );
};
}

 export default Integration; 

Also, use onChange instead of onClick for input change events as well as using the text value from state as the value of the input


<script type="text/babel">
  const { useState } = React

  const App = (props) => { 
    const [text, setText] = useState('hello');

    return (
      <div>
        <h1>{text}</h1>
        <input type="text" value={text} onChange={(e) => setText(e.target.value)} />
      </div>
    );
  }

  const rootElement = document.getElementById('root')
  ReactDOM.render(<App />, rootElement)
</script>

Eventually I came to the conclusion that I should use the CDN link instead of the font file. This way, in the new window, I load the font via the link and add that style to the whole page. The printData method can be updated this way :


export function printData(printDivId) {
const mywindow = window.open("", "PRINT");
mywindow.document.write(
    '<html><head><style>@font-face {font-family: BYekan;src: url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.eot");src: url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.eot?#iefix")format("embedded-opentype"),url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.woff2")format("woff2"),url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.woff")format("woff"),url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.ttf")format("truetype"),url("//db.onlinewebfonts.com/t/52ce4de2efeeb8b18dcbd379711224f3.svg#B Yekan")format("svg");} body,html {font-family: BYekan !important;}</style></head><body>'
  );
  mywindow.document.write(document.getElementById(printDivId).innerHTML);
  mywindow.document.write("</body></html>");
  mywindow.document.close();
  mywindow.focus();
  mywindow.print();
  mywindow.close();
  return true;
}

This is from the official docs which is using the development version docs


<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">

      ReactDOM.render(
        <h1>Hello, world!</h1>,
        document.getElementById('root')
      );

    </script>
    <!--
      Note: this page is a great way to try React but it's not suitable for production.
      It slowly compiles JSX with Babel in the browser and uses a large development build of React.

      To set up a production-ready React build environment, follow these instructions:
      * https://reactjs.org/docs/add-react-to-a-new-app.html
      * https://reactjs.org/docs/add-react-to-an-existing-app.html

      You can also use React without JSX, in which case you can remove Babel:
      * https://reactjs.org/docs/react-without-jsx.html
      * https://reactjs.org/docs/cdn-links.html
    -->
  </body>
</html>

If you use create-react-app there is a file in public/index.html or let's say in your index html page which you first render use cdn there like


<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#000000">  
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
    <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
    <title>React App</title>
  </head>

Think what you're looking for this. The below code (and working sample in the link) will create a "view finder". You can take this and sub in your images and MUI components. I didn't want to deal with a 3rd party lib to illustrate the guts of what the code does.


import * as React from "https://cdn.skypack.dev/react@17.0.1";
import * as ReactDOM from "https://cdn.skypack.dev/react-dom@17.0.1";

const keanuMovies = [
  "Bill & Ted",
  "Bill & Ted 2",
  "Bill & Ted 3",
  "Dracula",
  "John Wick",
  "Matrix",
  "Matrix 2",
  "Matrix 3",
  "Point Break",
  "Speed"
];

// max number of items to show
const increment = 3;

const App = () => <MovieBrowser />;

const MovieBrowser = () => {
  const [visibleMovies, setVisibleMovies] = React.useState(
    keanuMovies.slice(0, increment)
  );
  const [leftEdge, setLeftEdge] = React.useState(0)
  // as long as we've gone right, we can go back left
  const canGoLeft = leftEdge > 0;
  // basically a "peak ahead" to see if the 
  // next right move will go beyond the array limit
  const canGoRight = leftEdge + increment <= keanuMovies.length - 1;

  const handleGoLeftClick = (goLeft = false) => {
    // if going left will fall blow the 0 index, reset to 0
    // else, decrement 
    const updatedLeftEdge = leftEdge - increment < 0 ? 0 : leftEdge - increment;

    setVisibleMovies(
      keanuMovies.slice(updatedLeftEdge, updatedLeftEdge + increment)
    );
    setLeftEdge(updatedLeftEdge);
  };
  
  const handleGoRightClick = (goLeft = false) => {
    // if going right will go past the array len, select 
    // the next index after the previous move right
    let updatedLeftEdge =
      leftEdge + increment > keanuMovies.length - 1
        ? leftEdge + increment - (keanuMovies.length - 1 + increment)
        : leftEdge + increment;

    setVisibleMovies(
      keanuMovies.slice(updatedLeftEdge, updatedLeftEdge + increment)
    );
    setLeftEdge(updatedLeftEdge);
  };

  return (
    <div className="container">
      <h1>Keanu Movies</h1>
      <ul className="movies">
        {visibleMovies.map((movie) => (
          <li>{movie}</li>
        ))}
      </ul>
      <div className="actions">
        <button onClick={handleGoLeftClick} disabled={!canGoLeft}>
          Left
        </button>
        <button onClick={handleGoRightClick} disabled={!canGoRight}>
          Right
        </button>
      </div>
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById("root"));

And then a react component like like this (I have moved some code around to better follow some react idioms):


var Component = React.createClass({    
  componentDidMount:function() {
    greuler({
      target: '#chart',
      width: 480,
      height: 500,
      data: {
        nodes: [
          {id: 0, label: "E1Def3", r: 25},
          {id: 1, label: "E1P4", r: 15},
          {id: 2, label: "E1P2", r: 15},
          {id: 3, label: "E1P1", r: 15},
          {id: 4, label: "E1P5", r: 15},
          {id: 5, label: "E1P6", r: 25}
        ],
        links: [
          {source: 0, target: 1, directed: true},
          {source: 0, target: 2, directed: true},
          {source: 0, target: 3, directed: true},
          {source: 1, target: 4, directed: true},
          {source: 2, target: 5, directed: true},
          {source: 3, target: 4, directed: true},
          {source: 4, target: 5, directed: true}
        ]
      }
    }).update()
  }

  render() {
    return (
      <div id="chart"></div>
    );
  }
}

ReactDOM.render(<Component />, document.querySelector('root'));

Recommend

React Forwarding Refs Displaying a custom name in DevTools

React Forwarding Refs Forwarding refs in higher-order components

React Forwarding Refs Forwarding refs to DOM components

React Using the Effect Hook Tips for Using Effects Tip: Optimizing Performance by Skipping Effects

React Using the Effect Hook Tips for Using Effects Explanation: Why Effects Run on Each Update

React Using the Effect Hook Tips for Using Effects Tip: Use Multiple Effects to Separate Concerns

React Using the Effect Hook Recap

React Using the Effect Hook Effects with Cleanup Example Using Hooks

React Using the Effect Hook Effects with Cleanup Example Using Classes

React Using the Effect Hook Effects Without Cleanup Detailed Explanation

React Using the Effect Hook Effects Without Cleanup Example Using Hooks

React Using the Effect Hook Effects Without Cleanup Example Using Classes

React Using the Effect Hook

React Hooks API Reference Additional Hooks useDebugValue Defer formatting debug values

React Hooks API Reference Additional Hooks useDebugValue

React Hooks API Reference Additional Hooks useImperativeHandle

React Hooks API Reference Additional Hooks useRef

React Hooks API Reference Additional Hooks useMemo

React Hooks API Reference Additional Hooks useReducer Lazy initialization

React Hooks API Reference Additional Hooks useReducer Specifying the initial state

React Hooks API Reference Additional Hooks useReducer

React Hooks API Reference Basic Hooks useContext

React Hooks API Reference Basic Hooks useEffect Conditionally firing an effect

React Hooks API Reference Basic Hooks useEffect Cleaning up an effect

React Hooks API Reference Basic Hooks useEffect

React Hooks API Reference Basic Hooks useState Lazy initial state

React Hooks API Reference Basic Hooks useState Functional updates

React Hooks API Reference Basic Hooks useState

React Hooks at a Glance 🔌 Other Hooks

React Hooks at a Glance 💡 Building Your Own Hooks

React Hooks at a Glance ⚡️ Effect Hook

React Hooks at a Glance 📌 State Hook Declaring multiple state variables

React Hooks at a Glance 📌 State Hook

React SyntheticEvent Reference Pointer Events

React SyntheticEvent Reference Focus Events Detecting Focus Entering and Leaving

React SyntheticEvent Reference Focus Events onBlur

React SyntheticEvent Reference Focus Events onFocus

React SyntheticEvent Reference Clipboard Events

React SyntheticEvent Overview

React Accessibility Development and Testing Tools Development assistance eslint-plugin-jsx-a11y

React Accessibility Mouse and pointer events

React Accessibility Focus Control Programmatically managing focus

React Accessibility Accessible Forms Labeling

React Accessibility Semantic HTML

React Accessibility Standards and Guidelines WAI-ARIA

Add React to a Website Optional: Try React with JSX Run JSX Preprocessor

Add React to a Website Optional: Try React with JSX Quickly Try JSX

Add React to a Website Optional: Try React with JSX

Add React to a Website Add React in One Minute Tip: Minify JavaScript for Production

Add React to a Website Add React in One Minute Step 3: Create a React Component

Add React to a Website Add React in One Minute Step 2: Add the Script Tags

Add React to a Website Add React in One Minute Step 1: Add a DOM Container to the HTML

Create a New React App Recommended Toolchains Create React App

React Implementation Notes Top-Level Updates

React Implementation Notes Updating Host Components

React Implementation Notes Updating Composite Components

React Implementation Notes Updating

React Implementation Notes Unmounting

React Implementation Notes Introducing Internal Instances