Skip to content

Commit

Permalink
updated componentWillReceiveProps to UNSAFE_componentWillReceiveProps…
Browse files Browse the repository at this point in the history
… to fix warnings, issue #29
  • Loading branch information
Sahar Mehrpour committed Jan 15, 2020
1 parent ee2fe50 commit 34e7872
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ui/editRuleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ class EditRuleForm extends Component {


//componentDidUpdate doesn't work
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.message === "SEND_EXPR_STMT_XML") return;
if (nextProps.message === "CHANGE_GUI_ELEMENT") return;

Expand Down Expand Up @@ -1601,7 +1601,7 @@ class CustomDropDown extends Component {
)
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
menuItems: nextProps.menuItems,
onSelectFunction: nextProps.onSelectFunction,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/ruleGenerationGUI/guiComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class GuiComponent extends Component {
}

//componentDidUpdate doesn't work
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
let hoverCheckbox = {element: false};
// recover texts:
let texts = {};
Expand Down Expand Up @@ -1054,7 +1054,7 @@ class CustomDropDown extends Component {
)
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
menuItemsText: nextProps.menuItemsText,
menuItemsEvent: nextProps.menuItemsEvent,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ruleGenerationGUI/ruleGeneratorGui.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RuleGeneratorGui extends Component {
}

//componentDidUpdate doesn't work
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.ruleIndex !== -1) {
let indices = nextProps.rules.map(d => d.index);
let arrayIndex = indices.indexOf(this.ruleIndex);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ruleGenerationText/ruleGeneratorText.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RuleGeneratorText extends Component {
}

//componentDidUpdate doesn't work
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
let changedArray = false;
if (this.autoCompleteArray.length !== nextProps.autoCompleteArray.length) changedArray = true;
else this.autoCompleteArray.forEach((a, i) => {
Expand Down

0 comments on commit 34e7872

Please sign in to comment.