score:0

update

import react from "react";

export interface myprops {
  some: string;
  another: number;
  onemore: string;
}

const mycom:react.fc<myprops> = props =>{
...
};

now you have all them props and it includes children prop and default props as well


import * as react from "react";

export interface myprops {
  some: string;
  another: number;
  onemore: string;
}

export function mycomponent (props: myprops): react.reactelement<myprops> {
  const { some, another, onemore } = props;

  return (
     <p>{some}</p>
  )
}

score:0

seems to me like your issue is as follows. you have specified that your component accepts a string as a prop, but you are passing it a function. you would need to updated the props interface to not expect a string, but rather a function which returns a string. it would look something like this.

interface props {
    getstring: (value: any) => string;
}

now your component isn't expecting a string, but rather a function which matched the type you are passing in.

score:1

i suggest you use interface like so because in this way you can handle your prop and you can pass it a function or a string :

interface props {
 your_prop_name : (value? : any) => string | string
};

and use it in your component

const app : react.fc<props> = (props) => {
    return (
        <>
            {typeof props.your_prop_name  === "string" ? <div>{props.your_prop_name}</div> :  <div>{props.your_prop_name()}</div>}
        </>
    );
};

export default app;

Related Query

More Query from same tag