Recent searches
No recent searches
New App - Garden code example not working?
Posted Feb 01, 2023
Hello all! I am kinda new to React and want to try updating my existing custom app using the new scaffold.
I started a new app in ZCLI with the react scaffold and it works locally (I see the list of orgs).
However, if I copy the code from https://garden.zendesk.com/components/autocomplete Default layout and replace the contents of app.js with it, I get the following error:
/src/javascripts/modules/app.js: Unexpected token, expected "," (40:19)
38 | */
39 | const filterMatchingOptionsRef = useRef(
> 40 | debounce((value: string) => {
| ^
41 | const matchedOptions = options.filter(
42 | option => option.trim().toLowerCase().indexOf(value.trim().toLowerCase()) !== -1
43 | );
Any ideas what I am doing wrong? I made no other modification to the scaffold created by zcli.
Also to note, I have tried this using npm and yarn - same issue.
0
2
2 comments
Steven Aranaga
Thanks for that advice! Funny, it got passed that, but now I get this error.
0
Steven Aranaga
I found that I couldn't replace the scaffold app.js. When I import the sample as another JS and put it inside the <render> tags, it works. So, the issue was there was this thing being built, but no command to display it.
Thank you again for your comment, but wanted to note this in case someone else comes across it.
0