英文:
Using cdn of react-select in react js
问题
我想使用CDN引入react-select。我尝试将CDN下载到react-select中,但一直出现"select is not defined"错误。
我尝试下载了react-select的ZIP包,但我不知道如何使用它。
以下是我的操作:
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-select/5.7.3/index-2ce68625.prod.min.js" type="module"></script>
在JS文件中,我想要进行导入操作。
英文:
I want to use react-select with cdn. I tried downloading cdn into react-select but I keep getting error as select is not defined.
I tried to download the zip package of react-select with but I dont know how to use it.
Following is how I did it.
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-select/5.7.3/index-2ce68625.prod.min.js" type="module"></script>
and in js file I want to import.
答案1
得分: 0
你需要使用以下依赖项:
<script src="https://unpkg.com/react@16.7.0/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/emotion@9.2.12/dist/emotion.umd.min.js"></script>
<script src="https://unpkg.com/react-dom@16.7.0/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://unpkg.com/prop-types@15.5.10/prop-types.min.js"></script>
<script src="https://unpkg.com/react-input-autosize@2.2.1/dist/react-input-autosize.min.js"></script>
<script src="https://unpkg.com/react-select@2.1.2/dist/react-select.min.js"></script>
英文:
You have to use the dependencies
<script src="https://unpkg.com/react@16.7.0/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/emotion@9.2.12/dist/emotion.umd.min.js"></script>
<script src="https://unpkg.com/react-dom@16.7.0/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="https://unpkg.com/prop-types@15.5.10/prop-types.min.js"></script>
<script src="https://unpkg.com/react-input-autosize@2.2.1/dist/react-input-autosize.min.js"></script>
<script src="https://unpkg.com/react-select@2.1.2/dist/react-select.min.js"></script>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论