Pass a function from a Functional Component to a Class based Component

Parent Component is like below

import React, { useState } from "react";
import EntityDefinition from "./EntityDefinition";

export default function EntitySelection(props) {

  const testFun = () => {
    console.log("Function activated");
  return (
                />{/**Calling a Class based Component*/}

Class based Component (Child)

import React from "react";
import { ComboBox, DropdownOption, Button } from "react-widgets";
import axios from "axios";

export default class EntityDefinition extends React.Component {

  render() {
    return (
          {" "}
          <Button onClick={this.testFun}>Close</Button>{" "} {/*/Calling the function passed*/}

but when i clicked the button the testFun function is not being called. i tried something like onClick={this.state.testFun} , onClick={testFun} but nothing is happening. can someone point what am i doing wrong here.


testFun is a prop. So use this.props.testFun