Next.js · Middle · Question 46 of 75

What is opengraph-image.tsx useful for?

Explanation

By convention the file returns an ImageResponse with JSX markup - Next.js turns it into a PNG and adds the necessary <meta> tags. Handy for article previews with a title. In Next.js 16, params in such files is a promise too.

Further reading

Problem with a question

Next.js · Middle · question 46

Test yourself

Take the Next.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz