From 18a133601476f7e3d4a44a912164f56c2c720b57 Mon Sep 17 00:00:00 2001 From: Gerasimos <11447903+gerhat@users.noreply.github.com> Date: Fri, 20 Sep 2019 08:08:01 +0300 Subject: [PATCH] Fix on warning: "componentWillMount will be deprecated soon" Fixes the "componentWillMount will be deprecated soon" warning based on the official docs: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#adding-event-listeners-or-subscriptions --- src/Sticky.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sticky.js b/src/Sticky.js index fff3a208..44d29e11 100644 --- a/src/Sticky.js +++ b/src/Sticky.js @@ -30,7 +30,7 @@ export default class Sticky extends Component { style: {} }; - componentWillMount() { + componentDidMount() { if (!this.context.subscribe) throw new TypeError( "Expected Sticky to be mounted within StickyContainer"