13
rated 0 times
[
17]
[
4]
/ answers: 1 / hits: 5619
/ 4 Years ago, wed, june 10, 2020, 12:00:00
Can we dynamically import hooks based on the value passed to the component?
For eg.
App.js
<BaseComponent isActive />
BaseComponent.js
if(props.isActive) {
// import useActive (custom Hook)
}
I donot want these(custom hook) files to be imported and increase the size of BaseComponent even when the props contain falsey values.
More From » reactjs