Using default value for function parameter. #141
-
Hello, thank you for making this incredible library available. I'm trying to use Component example:
respective style
|
Beta Was this translation helpful? Give feedback.
Answered by
jpudysz
Feb 5, 2024
Replies: 1 comment
-
Hello, you need to follow React rules. You can't run In order to fix it, you need to do something like this: const ProgressBar = (
{
title,
startValue,
endValue = 100,
current,
goal,
lack,
colorBar
}: ProgressBarProps) => {
const { styles, theme } = useStyles(stylesSheet);
const { styles } = useStyles(stylesSheet);
const animated = useSharedValue(0);
const [width, setWidth] = useState(0);
const progressBarAnimated = useAnimatedStyle(() => {
return {
transform: [{
translateX: animated.value
}],
backgroundColor: colorBar ?? theme.colors.progressBar.default,
}
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DiegoGielda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, you need to follow React rules. You can't run
useStyles
outside of the React component.In order to fix it, you need to do something like this: