I've just started react, all react All of our resources are imported locally , It's hard to avoid going to the Internet to find a bag to use ,react Bao He reactdom, also babel All my bags are easy to find , The official website is ready to use , however prop-types It seems that Bao didn't see it on the official website , So I went to Baidu to find out more about my body , Finally put prop-types Download to local .
This tutorial is for computers that have been installed and configured npm Players of package management tools , No, npm It is suggested to go online to find the next tutorial , It's very practical. This thing .
First use npm Create a package.json, The specific operation is win+R Input cmd Open the little blackboard , Choose the right path And then use npm init Instructions to create new package.json, Enter all the way And we're done .
And then you type in npm i prop-types, In this path, you can find node_modules The folder ! Click on the folder to see what you want prop-types package , Just click in prop-types.js The file !