Skip to content

Commit

Permalink
fix failing FileWidget tests
Browse files Browse the repository at this point in the history
by changing to proper use of setState() without setImmediate() hacks (see rjsf-team#1197)
  • Loading branch information
sbusch committed May 17, 2019
1 parent cd1da42 commit 46f01ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/widgets/FileWidget.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from "react";
import PropTypes from "prop-types";

import { dataURItoBlob, shouldRender, setState } from "../../utils";
import { dataURItoBlob, shouldRender } from "../../utils";

function addNameToDataURL(dataURL, name) {
return dataURL.replace(";base64", `;name=${encodeURIComponent(name)};base64`);
Expand Down Expand Up @@ -79,7 +79,7 @@ class FileWidget extends Component {
values: filesInfo.map(fileInfo => fileInfo.dataURL),
filesInfo,
};
setState(this, state, () => {
this.setState(state, () => {
if (multiple) {
onChange(state.values);
} else {
Expand Down

0 comments on commit 46f01ec

Please sign in to comment.