Issue
I have default css file and separate css file that should be applied (to owerride default) only when certain conditions are met.
I am using create-react-app wit default import 'file.css'
syntax.
What is the best way forward to decide whether to load or not load particular css file dynamically?
Solution
You can use require('file.css')
syntax instead. This will allow you to put it inside of a conditional.
e.g.
if(someCondition) {
require('file.css');
}
Answered By - mpen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.