Reputation: 2630
for example like this:
import * as actions from '../actions';
@connect(null, actions);
export default class MyClass extends React.Component {
From a performance perspective, is it worth it to specify which actions a component uses?
Upvotes: 0
Views: 44
Reputation: 2223
It probably won't be a significant performance issue. There are most likely tons of other optimizations you can make (e.g. network related or managing re-renders) that will be much more effective than JS micro-optimizations like this.
That said, I always prefer to be explicit with imports and passing actions. I think it helps you consider exactly what a component's responsibilities are, which helps you keep your app well organized. I also think it makes the code more readable.
Upvotes: 1