team-made / boilerplate-pro

🔭 A platform for developers to find, integrate, and deploy the best boilerplate for their project.
https://boilerplate.pro
MIT License
2 stars 1 forks source link

List component ternary is constantly running. #93

Closed danraybernard closed 6 years ago

danraybernard commented 6 years ago

this.state.currentActive === 'all' ? this.props.getTopBoilerplates() : this.props.getBpsByLang(this.state.currentActive)

This line on the render method is causing the list component to constantly check the currently active language and rerun boilerplate requests. Is there any way we can ensure it only runs once or initialize a null state and somehow run on click only?