how to give a props to ui-kitten's Card header

826 Views Asked by At

I am trying to use ui-kitten framework in a simple test app but there are some concepts i think i don't understand yet. I am new on JS / React-native, this is my first app

In this example, can someone explain to me how to give a prop to Header ? CardWithHeader- Example

Why <View {...props}> seems to have rest parameters ?

Thank you for helping

1

There are 1 best solutions below

0
On

To give custom props to a UI-Kitten card header (or footer) you can do the following :

const Header = ({ title }) => (
  <Text>{title}</Text>
);

const title = 'Hello World!';

const myCard = () => (
  <Card header={(props) => <Header {...props} title={title} />}>
    Nice text
  </Card>
);