Skip to content

Why change from static properties to named exports for the new data-fetching methods? #12184

Discussion options

You must be logged in to vote

All of the above 😄

  • It's impossible to do the code elimination without having it as an explicit export as there are many ways the property could be assigned.
  • With class components the static method made sense semantically but since hooks were introduced everyone is more likely to write function components where the assignment was slightly strange
  • It's easier to type and extract the type of getStaticProps/getServerSideProps as they're not mixing with the React types

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rafaelalmeidatk
Comment options

Answer selected by rafaelalmeidatk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants