Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to react typescript callback function¨

import * as React from 'react';

interface ToggleProps {
    ClickHandler: (event: React.MouseEvent<HTMLButtonElement>) => void
}

export function Toggle(Props: ToggleProps) {
    return <button onClick={Props.ClickHandler}>Toggle</button>
}
 
PREVIOUS NEXT
Tagged: #react #typescript #callback
ADD COMMENT
Topic
Name
5+2 =