How to import unpkg components in react browser

Viewed 1919

I'm using React directly in the browser by importing from unpkg. But when I include the component react-pagination-js, Pagination still remains undefined throughout the rest of the scope.

<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>

<!-- react-js-pagination -->
<script src="https://unpkg.com/react-pagination-js@2.0.0/dist/index.umd.js"></script>

<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" src="{% static 'js/practice/ChallengeList.js' %}"></script>

<script type="text/babel">
  const e = React.createElement;
  const el = document.querySelector('#challenges-component');
  ReactDOM.render(e(ChallengeList), el);
</script>

How do I use Pagination in my ChallengeList component?

0 Answers
Related