Skip to content

using with nativewind #42

@iamhaaamed

Description

@iamhaaamed

Is it possible to use react-icomoon with nativewind?
I have used it like this:

import { styled } from 'nativewind';
import * as React from 'react';
import type { IconProps } from 'react-icomoon';
import IcoMoon from 'react-icomoon';
import { Path, Svg } from 'react-native-svg';

import iconSet from './selection.json';

const SIcoMoon = styled(IcoMoon);
export type NTIconProps = IconProps & {
  className?: string;
};

export const Icon = ({ className, style, ...props }: NTIconProps) => {
  return (
    <SIcoMoon
      native
      SvgComponent={Svg}
      PathComponent={Path}
      iconSet={iconSet}
      size={20}
      style={style}
      className={className}
      {...props}
    />
  );
};

but neither class nor style works for react-icomoon. I have used nativewind with react native built-in components and also other components like fast image and it's working but not with react-icomoon.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions