Skip to content

Commit 4dc0d06

Browse files
author
Luca Nardi
committed
Fix broken build
1 parent bdd4ba4 commit 4dc0d06

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

content/community/conferences.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ April 12, 2019 in Amsterdam, The Netherlands
2727

2828
[Website](https://react.amsterdam) - [Twitter](https://twitter.com/reactamsterdam) - [Facebook](https://www.facebook.com/reactamsterdam)
2929

30-
### ReactJS Girls Conference
30+
### ReactJS Girls Conference {#reactjs-girls-conference}
3131
May 3, 2019 in London, UK
3232

3333
[Website](https://reactjsgirls.com/) - [Twitter](https://twitter.com/reactjsgirls)

examples/react-component-reference/get-snapshot-before-update.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ class ListaScorrimento extends React.Component {
44
this.rifLista = React.createRef();
55
}
66

7-
getSnapshotBeforeUpdate(propsPrecedenti, statePrecedente) {
7+
getSnapshotBeforeUpdate(
8+
propsPrecedenti,
9+
statePrecedente
10+
) {
811
// Stiamo aggiungendo nuovi elementi alla lista?
912
// Salviamo la posizione dello scroll in modo da poterla aggiustare in seguito.
10-
if (propsPrecedenti.list.length < this.props.list.length) {
13+
if (
14+
propsPrecedenti.list.length < this.props.list.length
15+
) {
1116
const lista = this.rifLista.current;
1217
return lista.scrollHeight - lista.scrollTop;
1318
}
1419
return null;
1520
}
1621

17-
componentDidUpdate(propsPrecedenti, statePrecedente, snapshot) {
22+
componentDidUpdate(
23+
propsPrecedenti,
24+
statePrecedente,
25+
snapshot
26+
) {
1827
// Se snapshot è definito, abbiamo appenan aggiunto nuovi elementi alla lista.
1928
// Aggiustiamo lo scroll in modo che i nuovi elementi non spingano quelli
2029
// preesistenti fuori dallo schermo.

0 commit comments

Comments
 (0)