Using Amap, map is not defined in react

I currently copy it according to Gao de document . I quote it globally in index.html, and then I will report this prompt. It is normal for me to use the function in api. I would like to ask whether I need to change the way I quote api, or where is the problem? thank you.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title> </title>
    <link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css" />
    <!-- API -->
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.6&key=key"></script>
    <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    <!-- API -->
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

</head>

<body>
    <div id="root"></div>
</body>

</html>


Mar.20,2021

addToolbar.js this seems to be useless, just comment it out. --

Menu