Check out example codes for "dynamic classes scss". It will help you in understanding the concepts better.

Code Example 1

You can do dynamic classes in sass and scss with no problem since they are compiled before runtime!

Learn ReactJs, React Native from akashmittal.com