I don't see anything in the docs specifically about SS
, I know P
=props, and S
=state but SS
?
edit
Sorry, I was referencing this from a React+TypeScript project, namely @types/react
. I have added the typescript
tag.
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L395
It's used in the return value of getSnapshotBeforeUpdate
so I'm betting it stands for SnapShot.
Runs before React applies the result of
render
to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position beforerender
causes changes to it.
And the docs in that file for componentDidUpdate
show it accepts a third argument called snapshot that says:
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
So, SS
is the user defined type of the snapshot returned by your custom implementation of getSnapshotBeforeUpdate
, which gets passed to componentDidUpdate
so you can preserve some application specific details from the last render.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With