'How to access functional component inside a function from an external JS file?
export default function HorizontalLabelPositionBelowStepper() {
const [activeStep, setActiveStep] = React.useState(0);
const [completed, setCompleted] = React.useState({});
const handleComplete = () => {
const newCompleted = completed;
newCompleted[activeStep] = true;
setCompleted(newCompleted);
handleNext();
};
<button
className="footerSaveButton"
disabled={
selectedCoach || selectedValue || selectedCustomer
? disabled
: !disabled
}
onClick={routeChange}
// onClick= {() => {routeChange();handleComplete();}}
>
Save and Continue
</button>
There is a const type functional component inside an export default function. I want to access that functional component on my button click that is also inside a function from an external JS file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
