1 |
- [{"C:\\WORK_homework\\js\\26_react\\myproject\\src\\index.js":"1","C:\\WORK_homework\\js\\26_react\\myproject\\src\\reportWebVitals.js":"2","C:\\WORK_homework\\js\\26_react\\myproject\\src\\App.js":"3"},{"size":500,"mtime":499162500000,"results":"4","hashOfConfig":"5"},{"size":362,"mtime":499162500000,"results":"6","hashOfConfig":"5"},{"size":1059,"mtime":1611346135648,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"10"},"jfy5tz",{"filePath":"11","messages":"12","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"13","messages":"14","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"15","usedDeprecatedRules":"10"},"C:\\WORK_homework\\js\\26_react\\myproject\\src\\index.js",[],["16","17"],"C:\\WORK_homework\\js\\26_react\\myproject\\src\\reportWebVitals.js",[],"C:\\WORK_homework\\js\\26_react\\myproject\\src\\App.js",["18"],"import React, { Component, useState } from \"react\";\nimport \"./App.css\";\n\nconst Input = () => {\n const [value, setValue] = useState(\"try\");\n return (\n <>\n <input value={value} onChange={(e) => setValue(e.target.value)} />\n <h1> {value.toUpperCase()}</h1>\n </>\n );\n};\n\nconst Spoiler = ({ children, header: Header }) => {\n const [show, setShow] = useState(true);\n return (\n <>\n <Header onClick={() => setShow(!show)} />\n {show && children}\n {true}\n </>\n );\n};\n\nconst App = () => {\n return (\n <>\n <Spoiler header={({ ...props }) => <h2 {...props}>Show</h2>}>\n <Input />\n <Input />\n <Spoiler\n header={({ onClick }) => (\n <button onClick={onClick}>Show</button>\n )}\n >\n <Input />\n <Input />\n </Spoiler>\n </Spoiler>\n </>\n );\n};\n\nexport default App;\n",{"ruleId":"19","replacedBy":"20"},{"ruleId":"21","replacedBy":"22"},{"ruleId":"23","severity":1,"message":"24","line":1,"column":17,"nodeType":"25","messageId":"26","endLine":1,"endColumn":26},"no-native-reassign",["27"],"no-negated-in-lhs",["28"],"no-unused-vars","'Component' is defined but never used.","Identifier","unusedVar","no-global-assign","no-unsafe-negation"]
|