Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Learn WordPress Content Feedback - Missing import statement in the final code #1566

Closed
4 tasks
RockyKev opened this issue May 21, 2023 · 3 comments
Closed
4 tasks
Assignees
Labels
[Content] Feedback Feedback provided about content on Learn.

Comments

@RockyKev
Copy link

Feedback Details

Write a description of your feedback here:

Assuming the student will copy/paste this final code. If they try to run it, they'll run into a error.

Proposed change:

import { SearchControl, Spinner } from "@wordpress/components";
import { useState, render } from "@wordpress/element";
import { useSelect } from "@wordpress/data";
import { store as coreDataStore } from "@wordpress/core-data";
import { decodeEntities } from "@wordpress/html-entities";

Feedback Report Checklist:

  • Feedback validated
  • Update proposed
  • Update reviewed
  • Update published
@RockyKev RockyKev added Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. [Content] Feedback Feedback provided about content on Learn. labels May 21, 2023
@ironnysh
Copy link

ironnysh commented Jun 7, 2024

Feedback Validation Checklist:

Can you confirm/reproduce the issue? Yes:

As @RockyKev mentions, the following is missing from the final code snippet that's provided at the bottom of this page:

import { decodeEntities } from "@wordpress/html-entities";

This results in an error logged in the browser console (and in VS Code). See screenshots below:
Screenshot 2024-06-07 at 14 50 07
Screenshot 2024-06-07 at 14 40 58


What should happen next to apply the feedback?: Add the missing import to the code sample.

@jonathanbossenger jonathanbossenger self-assigned this Jun 7, 2024
@jonathanbossenger jonathanbossenger removed the Awaiting Triage Issues awaiting triage. See Training Team handbook for how to triage issues. label Jun 7, 2024
@jonathanbossenger
Copy link
Collaborator

@ironnysh thanks, I've updated the final code snippet, could you please test and verify that it's not correct.

@ironnysh
Copy link

ironnysh commented Jun 7, 2024

Yup, works as expected. Thanks, @jonathanbossenger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Content] Feedback Feedback provided about content on Learn.
3 participants