I want to put swr data into setState[]

I have code like this.

const { data } = useSWR('/api/data', fetcher);
const [contents, setcontents] = useState<Array<string>>([]);

json is like this

console.log(data) 

Text: Array(5)
0: {id: 1, title: '123', content: 'hi'}
1: {id: 2, title: '1234', content: 'qq'}
2: {id: 3, title: '12323', content: 'ww'}
3: {id: 4, title: '123124', content: 'ee.'}
4: {id: 5, title: '24124', content: 'rr.'}

I want to output content in json as map and put it in setContents.

I think you can create a function and output it as a map, then call setContents and put a value in the return value, but it doesn’t seem to work..

How can I put json array contents in setContents??