Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Component Mapping not applying correctly #1833

Open
AngelRmrz opened this issue Nov 5, 2024 · 0 comments
Open

Custom Component Mapping not applying correctly #1833

AngelRmrz opened this issue Nov 5, 2024 · 0 comments

Comments

@AngelRmrz
Copy link

💬 ¿How to correctly use Custom Component Mapping?

Im facing several issues trying to use a custom component mapping, i first base on the documentation but it doesnt works, here is my currently not working approach

The IconButton.tsx file

import React from 'react';
import {EvaProp, withStyles} from '@ui-kitten/components';
import {TouchableOpacity, TouchableOpacityProps} from 'react-native';

interface IconButtonProps extends TouchableOpacityProps {
  eva?: EvaProp;
}

const IconButton: React.FC<IconButtonProps> = ({eva, style, ...props}) => {
  return <TouchableOpacity style={[eva?.style, style]} {...props} />;
};

export default withStyles(IconButton);

Here is my mapping.json file

"IconButton": {
      "meta": {
        "parameters": {
          "width": {
            "type": "number"
          },
          "height": {
            "type": "number"
          },
          "borderRadius": {
            "type": "number"
          },
          "backgroundColor": {
            "type": "string"
          }
        }
      },
      "appearances": {
        "filled": {
          "mapping": {
            "width": 40,
            "height": 40,
            "borderRadius": 20,
            "backgroundColor": "color-white"
          }
        }
      }
    }

I got this error log on the simulator

Simulator Screenshot - iPhone Xs - 2024-11-05 at 15 32 53

I appreciate any comments here for this approach or another.

UI Kitten and Eva version

Package Version
@eva-design/eva ^2.2.0
@ui-kitten/components ^5.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant