Check out example codes for "p5 js cdn". It will help you in understanding the concepts better.

Code Example 1

<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.js"></script>

Code Example 2

<script src="../p5.min.js"></script>

Learn ReactJs, React Native from akashmittal.com