Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Latest commit

 

History

History
24 lines (17 loc) · 558 Bytes

prefer-separate-component-file.md

File metadata and controls

24 lines (17 loc) · 558 Bytes

Enforces that all connected components are defined in a separate file (react-redux/prefer-separate-component-file)

And imports it to the container.

Rule details

The following pattern is considered incorrect:

const Component = () => {};
connect(mapStateToProps, null)(Component)

The following patterns are considered correct:

import Component from './component';
connect(mapStateToProps, mapDispatchToProps)(Component)
const Component = require('./component')
connect(mapStateToProps, mapDispatchToProps)(Component)