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