import React, { useState } from 'react'; import { Flex, Rate } from 'antd'; const desc = ['terrible', 'bad', 'normal', 'good', 'wonderful']; const App: React.FC = () => { const [value, setValue] = useState(3); return ( {value ? {desc[value - 1]} : null} ); }; export default App;