-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 4.4 KB
/
.eslintcache
1
[{"C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\index.js":"1","C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\App.js":"2","C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\reportWebVitals.js":"3","C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\recipe.js":"4"},{"size":500,"mtime":499162500000,"results":"5","hashOfConfig":"6"},{"size":2428,"mtime":1609763291569,"results":"7","hashOfConfig":"6"},{"size":362,"mtime":499162500000,"results":"8","hashOfConfig":"6"},{"size":838,"mtime":1609695835782,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"mqv3sj",{"filePath":"13","messages":"14","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"15","usedDeprecatedRules":"12"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\index.js",[],["20","21"],"C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\App.js",["22"],"import React, {useEffect, useState} from 'react';\nimport logo from './logo.png'\nimport * as ReactBootStrap from \"react-bootstrap\"\nimport magnifier from './magnifier.png'\nimport Recipe from './recipe'\nimport './App.css';\n\nconst App = () => {\n\n const APP_ID = 'efeb319f';\n const APP_KEY = 'ac63eb35afff6caf46b0f48cb7ef6199';\n\n const [recipes, setRecipes] = useState([]);\n const [search, setSearch] = useState('');\n const [query, setQuery] = useState('chicken');\n const [loading, setLoading] = useState(false);\n const [results, setResults] = useState('0');\n\n useEffect(() => {\n getRecipes();\n }, [query]);\n\n const getRecipes = async () => {\n const response = await fetch(`https://api.edamam.com/search?q=${query}&app_id=${APP_ID}&app_key=${APP_KEY}`);\n setLoading(true);\n const data = await response.json();\n setRecipes(data.hits);\n setResults(data.count)\n }\n\n\n const updateSearch = e => {\n setSearch(e.target.value);\n }\n\n const getSearch = e => {\n setLoading(false);\n e.preventDefault();\n setQuery(search)\n }\n\n return (\n <div className=\"App\">\n <div className=\"header\">\n <img src={logo} alt=\"logo\" className=\"logo\"/> \n\n <div className=\"search\">\n <form onSubmit={getSearch}>\n <input type=\"text\" placeholder=\"Search\" className=\"search-input\" value={search} onChange={updateSearch} />\n <input type=\"image\" src={magnifier} alt=\"magnifier\" className=\"submit-bnt\"/>\n </form>\n </div>\n </div>\n\n {\n results === 0\n ?\n <div className=\"no-results\">\n <p>No results for your search...</p>\n </div>\n :\n <div className=\"recipes-list\">\n {\n loading \n ?\n recipes.map(recipe => (\n <Recipe \n key={recipe.recipe.label}\n title={recipe.recipe.label}\n calories={recipe.recipe.calories}\n img={recipe.recipe.image}\n ingredients={recipe.recipe.ingredients}\n />\n ))\n :\n <div>\n <ReactBootStrap.Spinner animation=\"grow\" size=\"sm\" className=\"small-spinner\" />\n <ReactBootStrap.Spinner animation=\"grow\" />\n <ReactBootStrap.Spinner animation=\"grow\" size=\"sm\" className=\"small-spinner\" />\n </div>\n }\n </div>\n }\n </div>\n );\n}\n\nexport default App;","C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\reportWebVitals.js",[],"C:\\Users\\ddvit\\Downloads\\recipe-app\\src\\recipe.js",[],{"ruleId":"23","replacedBy":"24"},{"ruleId":"25","replacedBy":"26"},{"ruleId":"27","severity":1,"message":"28","line":21,"column":6,"nodeType":"29","endLine":21,"endColumn":13,"suggestions":"30"},"no-native-reassign",["31"],"no-negated-in-lhs",["32"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getRecipes'. Either include it or remove the dependency array.","ArrayExpression",["33"],"no-global-assign","no-unsafe-negation",{"desc":"34","fix":"35"},"Update the dependencies array to be: [getRecipes, query]",{"range":"36","text":"37"},[605,612],"[getRecipes, query]"]