Enum value not getting

import { ControlProps, isStringControl, RankedTester, rankWith } from ‘@jsonforms/core’;
import { withJsonFormsControlProps } from ‘@jsonforms/react’;
import { FormControl, Grid, InputLabel, TextField, Select, MenuItem } from ‘@mui/material’;

const MuiSelectControl = (props: ControlProps) => (
<Grid sx={{ mb: 2 }}>
<InputLabel htmlFor={props.label} required sx={{ fontWeight: 500, color: ‘#082253’ }}>
{props.label}

<FormControl fullWidth sx={{ m: 0 }}>
<Select
value={props.data}
onChange={(event) => props.handleChange(props.path, event.target.value)}
error={!!props.errors}
disabled={!props.enabled}
displayEmpty
>

Storage Type

{props?.schema?.enum?.map((option: string, index: number) => (

{option}

))}



);

const MuiTextFieldControl = (props: ControlProps) => (
<Grid sx={{ mb: 2 }}>
{props.label}
<FormControl fullWidth sx={{ m: 0 }}>
<TextField
value={props.data}
onChange={(event) => props.handleChange(props.path, event.target.value)}
error={!!props.errors}
helperText={props.errors || props.description}
disabled={!props.enabled}
/>


);

const MuiSelectControlTester: RankedTester = rankWith(2, (schema) => schema.type === ‘string’ && schema.enum);
const MuiTextFieldControlTester: RankedTester = rankWith(2, isStringControl);

export const rendererEntries = [
{
renderer: withJsonFormsControlProps(MuiSelectControl),
tester: MuiSelectControlTester,
},
{
renderer: withJsonFormsControlProps(MuiTextFieldControl),
tester: MuiTextFieldControlTester,
},
];

I created a renderer for select and textfield but i am not able to render the fields i am checking the select field with the tester but i am not getting the enum value in this place

const MuiSelectControlTester: RankedTester = rankWith(2, (schema) => schema.type === ‘string’ &&

schema.enum

);

This question is related to this one.

By using the tester isStringControl your renderer will be used for all controls which refer to a type string. So if you have some type: 'string' properties in your JSON Schema which are not enums, then their associated schema.enum will be empty.

You need to make sure to use a tester which actually checks that your renderer is only called for enum properties. See here for an example in JSON Forms.