Don't Break the Implicit Prop Contract
Published ....
Last modified ....
Share this post on BlueskySee discussion on Bluesky
There's a "secret" implicit prop contract that comes along with all React components, and in fact with most "pure functions" and their arguments! Most React developers may not realize this contract is there, but they often follow it out of convention anyway. In this post I wanted to dig into this implicit prop contract, and specifically spend some time outlining why you shouldn't break it!
What is this about an implicit prop contract?!?
React components were designed to be pure functions. Many have probably heard or seen the concept of ui = f(state) or "UI as a function of state", it's a great way to conceptualize this expectation that React sets on us as we use it to build our user interfaces. This expectation implies a strict prop contract - specifically:
Changes to the props passed to a component, should reflect changes to the user
interfaceexperience
