Prechádzať zdrojové kódy

Improve Edit Recipe spinner

Tatiana Inama 6 rokov pred
rodič
commit
97805239cb

+ 3 - 1
recipes/src/containers/Recipes/Edit/index.tsx

@@ -33,7 +33,8 @@ class EditRecipe extends React.Component<EditRecipeProps, EditRecipeState> {
     getRecipeById(this.props.match.params.id).then(recipe => 
       this.setState({
         form: recipe,
-        loadingRecipe: false,
+      }, () => {
+        this.setState({ loadingRecipe: false })
       }))
 
   }
@@ -55,6 +56,7 @@ class EditRecipe extends React.Component<EditRecipeProps, EditRecipeState> {
 
   render() {
     const { form, loadingRecipe } = this.state;
+    console.log("loading", loadingRecipe)
     return (
       <div>
         { loadingRecipe && (<Spinner/>)}