diff --git a/sections/tooling/babel-plugin.md b/sections/tooling/babel-plugin.md index 1da66f54..fb791a63 100644 --- a/sections/tooling/babel-plugin.md +++ b/sections/tooling/babel-plugin.md @@ -83,6 +83,31 @@ You can force the component `displayName` to be solely the component name by dis One example you might want to do this, is testing components with enzyme. While you can always use `.find(ComponentName)` it's definitely possible to search component by its displayName with `.find("ComponentName")`. In the latter case you will need to disable the `fileName` option. If you do want this for testing only, make sure to add this only under your test environment. +#### Control which file names are meaningless + +A common pattern is to put components in `Button/index.jsx` instead of `Button.jsx`. By default, if the `fileName` option is set to `true`, the plugin will generate the display name using the directory name (`