You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the first argument of the onPress's callback function is not the next function but the ref of the <Button/> (so it returns us a <span/>). The next function is actually the second parameter of the callback function.
<AwesomeButtontype="primary"role="button"onPress={(ref,next)=>{// next is the second parameter !next();}}>
Portfolio
</AwesomeButton>
Either the documentation is incomplete, either it's a bug that needs to be fixed. I'll make a PR proposing an update to the current documentation.
import { AwesomeButtonProgress } from 'react-awesome-button';
import AwesomeButtonStyles from 'react-awesome-button/src/styles/styles.scss'
function Button() {
return (
<AwesomeButtonProgress
cssModule={AwesomeButtonStyles}
type="primary"
onPress={next => {
// do a sync/async task then call
next()
console.log("test");
next()
}}
>
Button
);
}
i tried this code that i get from 'AwesomeButtonProgress basic example' docs
The text was updated successfully, but these errors were encountered: