Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

How to change border Color of thumb of switch react core component

$
0
0

enter image description hereon pressing the thumb of switch of react native its giving me default color in place of thumb color border should be of nearby to orange how to eliminate it? and substitute the color

import React, { FunctionComponent } from 'react';import { Switch, View } from 'react-native';import { useTheme } from 'react-native-paper';interface IMSwitchProps {  toggleValue: boolean;  onToggleChange: (value?: any) => void;  disableSwitch?: boolean;  testId?: string;}const IMSwitch: FunctionComponent<IMSwitchProps> = (props: IMSwitchProps) => {  const theme = useTheme();  return (<View><Switch        value={props.toggleValue}        onValueChange={(value) => {          props.onToggleChange(value);        }}        trackColor={{          false: props.disableSwitch ? theme.Palette.grey[100] : theme.Palette.grey[500],          true: props.disableSwitch ? theme.Palette.grey[100] : theme.Palette.IMPrimary.border,        }}        thumbColor={          props.disableSwitch            ? theme.Palette.background            : props.toggleValue            ? theme.Palette.IMPrimary.main            : theme.Palette.background        }        disabled={props.disableSwitch}        testID={props.testId}      /></View>  );};export default IMSwitch;

tried by giving style to switch


Viewing all articles
Browse latest Browse all 6290

Trending Articles