fix react-hooks/exhaustive-deps issues
This commit is contained in:
parent
fd9b80a2cc
commit
15d72c5333
|
@ -13,6 +13,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LINGDOCS_DICTIONARY_URL: ${{ secrets.LINGDOCS_DICTIONARY_URL }}
|
||||
LINGDOCS_NPM_TOKEN: ${{ secrets.LINGDOCS_NPM_TOKEN }}
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 15.x]
|
||||
|
|
|
@ -19,7 +19,7 @@ yarn start
|
|||
|
||||
### Website
|
||||
|
||||
To build the Pashto [Pashto Verb Explorer](https://verbs.lingdocs.com) website:
|
||||
To build the [Pashto Verb Explorer](https://verbs.lingdocs.com) website:
|
||||
|
||||
```
|
||||
yarn build-website
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/lingdocs/pashto-inflector.git"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry":"https://reg.lingdocs.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.6"
|
||||
},
|
||||
|
|
|
@ -60,7 +60,11 @@ function VerbFormDisplay({ displayForm, textOptions, info, showingFormInfo, engl
|
|||
if (length === "mini" && !("mini" in chosenPersInf)) {
|
||||
setLength("long");
|
||||
}
|
||||
setPersInf("mascSing");
|
||||
// setPersInf("mascSing");
|
||||
setShowingExplanation(false);
|
||||
}, [block, length, chosenPersInf]);
|
||||
// TODO: This could be handled better to avoid the react-hooks/exhaustive-deps warning ?
|
||||
useEffect(() => {
|
||||
setShowingExplanation(false);
|
||||
}, [block]);
|
||||
const hasVariations = (!("masc" in form)) && (!("p" in form)) && (!isSentenceForm(form)) && !isAllOne(form as T.VerbBlock | T.ImperativeBlock);
|
||||
|
|
|
@ -27,7 +27,7 @@ function VerbInfoItemDisplay({ item, textOptions, tails }: {
|
|||
: x
|
||||
);
|
||||
useEffect(() => {
|
||||
setLength((length === "mini" && !("mini" in item)) ? "short" : length);
|
||||
setLength(l => (l === "mini" && !("mini" in item)) ? "short" : l);
|
||||
}, [item]);
|
||||
// const lengthsAvailable = "long" in item
|
||||
// ? [...["long", "short"], ..."mini" in item ? ["mini"] : []]
|
||||
|
|
Loading…
Reference in New Issue