B
B
balex7772021-12-29 10:24:02
React
balex777, 2021-12-29 10:24:02

How to pass an object to value in react-autosuggest?

How to pass an object to value in react-autosuggest ?
All examples show that value gets name, not even year

const languages = [
  {
    name: 'C',
    year: 1972,
  },
  {
    name: 'C#',
    year: 2000,
  },
];


and I generally need an object
const languages = [
  {
    name: 'C',
    value: {id:1972, name: C},
  },
  {
    name: 'C#',
    value: {id:1972, name: C},
  },
];

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question