From 149b09bd81bbde24c28280197b89ea149525a7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Bermejo?= Date: Sat, 18 Apr 2020 16:37:51 +0200 Subject: [PATCH] Fix componentWillMount warning on React Native 0.61.5+ If you currently use the component on this version or higher (haven't checked the exact version where this became an issue), you will get a warning asking you to rename this function to componentDidMount. So I have done that, as well as tested that the component worked as usual, and so it has. --- checkbox.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/checkbox.js b/checkbox.js index 4f9ffe6..09fc5f5 100644 --- a/checkbox.js +++ b/checkbox.js @@ -41,7 +41,8 @@ class CheckBox extends Component { }); } } - componentWillMount() { + + componentDidMount() { this.setState(this.baseState) }