how to import libraries from cdn in reactjs?

前端 未结 3 1954
难免孤独
难免孤独 2020-12-28 14:22

I have tried:

import \'maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\';

but it produces error. How can i import a cdn in my

3条回答
  •  余生分开走
    2020-12-28 14:53

    You can include these lines within your html file:

    
    
    
    

    Or, you can import a local stylesheet file that contains the import instruction. See the example below:

    App.js

    import './App.scss';
    

    App.scss

    @import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
    

提交回复
热议问题