React - component in seperate script does not work

前端 未结 3 434
名媛妹妹
名媛妹妹 2020-12-11 18:27

I\'m trying to learn react.js, but got stuck on \"Hello World\" script.

My index.html:



  
    

        
3条回答
  •  庸人自扰
    2020-12-11 18:50

    I suggest you boot up a web server.

    This python -m SimpleHTTPServer will boot up a simple web server.

    You can run this in your directory. Access it here http://localhost:8000.

    Or, you can use Chrome flags and add this line --allow-file-access-from-files

    Notes

    1. Python come pre-packaged with an OSX installation, so if you're on a Mac, good.

    2. Chrome flags is not recommended as it is tedious of a process.

提交回复
热议问题