Explore Library
Code QuizIntermediate

Dynamic Header with setOptions

Find the bug that causes an infinite render loop with setOptions.

Codejavascript
function DetailsScreen({ navigation, route }) {
  navigation.setOptions({ title: route.params.name });
  return <Text>{route.params.name}</Text>;
}

What is the bug in this code?