vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.84k stars 26.65k forks source link

Styling do not working with @bem-react/* and next #23739

Closed polRk closed 3 years ago

polRk commented 3 years ago

What version of Next.js are you using?

10.1.3

What version of Node.js are you using?

15

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

I'm use @bem-react/core, @bem-react/classname, and i wan't import style for my component.

import './Icon.css'

const Icon = () => <span className={cn('Icon', {theme: 'primary'})}>{children}

Expected Behavior

Import component specific css file

To Reproduce


import React from 'react'
import { cn } from '@bem-react/classname'

import './Block.css'

const cnBlock = cn('Block')
export const Block: React.FC = () => <i className={cnBlock({theme: 'red'})}>Some block</i>

All nexjs solutions about styling do not working with bem-react

polRk commented 3 years ago

I do not want to add all my 100500 block variants into my production bundle. Also, i want to make A/B tests with lazy loading dynamic parts