0
プロジェクトでは、文字列を返し、次の参照を持っている:Webpack&Css-loader。 Reactの動的classNameの作成方法
const left = slide.imageLeft; // introLeft
し、さらには、それが内部コンポーネントに反応レンダリングします。しかし、それは文字列styles.imageLeft
として返され、webpack doestは914u923asdsajdlj1l23
のような対応するバンドルされたクラスに変換するので、スタイルは適用されません。
<div className={`styles.${left}`}> </div>
P.S私はevalにしようとしましたが、それは2のエラーを削除します。
There is an internal error in the React performance measurement code. Did not expect componentDidMount timer to start while render timer is still in progress for another instance.
そして
ReferenceError: styles is not defined
あなたは、CSS-ローダーのための動的クラスの生成を達成することが可能な方法を提案してくださいすることができます。
達成したいことと現在の問題点を明確にしてください。 css-loaderが提供するCSSモジュールオプションを使用していますか? – fvgs