SolidJSS
SolidJSโ€ข17mo agoโ€ข
7 replies
Mr Void

Reset signals when prop value changes

How can I reset the showFront state of Card when Card's props.data changes?


type CardProps = {
    data: Card
}

const Card = (props: CardProps) => {
    const [showFront, setShowFront] = createSignal<boolean>(true)
    // ...
}


return (
    <Container>
        <Card data={currentCard()} />
        <!-- buttons to navigate between cards -->
    </Container>
)
Was this page helpful?