Skip to content

Commit b59358d

Browse files
committed
docs: add reference to the getClassName helper
1 parent 004e869 commit b59358d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ NODE_ENV=production ./test
7575
1. Iterates through all [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html) element declarations.
7676
1. Uses the `styleName` value to resolve the generated CSS class name of the CSS module.
7777
* If `styleName` value is a string literal, generates a string literal value.
78-
* If `styleName` value is non-string (variable, condition, etc.), uses a helper function to construct `className` value at the runtime.
78+
* If `styleName` value is a [`jSXExpressionContainer`](https://github.com/babel/babel/tree/master/packages/babel-types#jsxexpressioncontainer), uses a helper function ([`getClassName`](./src/getClassName.js)) to construct the `className` value at the runtime.
7979
1. Removes the `styleName` attribute from the element.
8080
1. Appends the resulting `className` to the existing `className` value (or creates `className` attribute if one does not exist).
8181

@@ -177,7 +177,7 @@ import bar from './bar1.css';
177177

178178
### Runtime `styleName` resolution
179179

180-
When the value of `styleName` cannot be determined at the compile time, `babel-plugin-react-css-modules` inlines all possible styles into the file. It then uses `getClassName` helper function to resolve the `styleName` value at the runtime.
180+
When the value of `styleName` cannot be determined at the compile time, `babel-plugin-react-css-modules` inlines all possible styles into the file. It then uses [`getClassName`](https://github.com/gajus/babel-plugin-react-css-modules/blob/master/src/getClassName.js) helper function to resolve the `styleName` value at the runtime.
181181

182182
Input:
183183

0 commit comments

Comments
 (0)