简体   繁体   中英

How to import a CSS file in a React Component on Electron

I have seen that it is used

import React from 'react';
import './cssName.css';

but it does not work for me, I am working on the electron app and add react as shown here

https://reactjs.org/docs/add-react-to-a-website.html

It is not working because you do not have a build process set up. You will need to setup webpack or something like that to be able to import css.

I suggest you read this article: https://flaviocopes.com/react-electron/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM