Build a Bug Emoji Picker - Step 8

Tell us what’s happening:

Hey everyone! :waving_hand: I’m stuck on Step 8 of the “Build a Bug Emoji Picker” project (Front-End Development Libraries Certification).

The task asks me to implement a render method inside the Bee class, prefixed by the override keyword, to update the innerText property of emojiElement with the value of emoji.

Here’s my current code:

class Bee extends Bug<string> {
  constructor(emojiElement: HTMLParagraphElement) {
    super(emojiElement);
    this.emoji = "🐝";
  }

  over

### Your code so far


```html
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Bug Emoji Picker</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <main>
      <form id="bug-form">
        <label for="species">Species:</Label>
        <select id="species">
          <option value="bee" selected>🐝 Bee</option>
          <option value="spider">🕷️ Spider</option>
        </select>
      </form>
      <div>
        <p id="bug-emoji">🐝</p>
      </div>
    </main>
  </body>
  <script src="index.ts"></script>
</html>
/* file: styles.css */
:root {
  --gradient-back: #987284;
  --gradient-left: #F9B5AC;
  --gradient-right: #AA7674;
  --card: #FFFFFF;
  --card-shadow: 0 10px 30px rgba(30, 41, 59, 0.12);
  --font: #222;
}

html {
  width: 100%;
  min-height: 100%;
  background: radial-gradient(100% 100% at 10% 10%, var(--gradient-left), transparent 60%),
              radial-gradient(90% 85% at 90% 0%, var(--gradient-right), transparent 55%),
              linear-gradient(180deg, var(--gradient-back), #ffffff);
}

body {
  margin: 5rem auto;
  padding: 2rem 3rem;
  width: fit-content;
  min-width: 15%;
  color: var(--font);
  font: 500 16px/1.4 system-ui;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15%;
  box-shadow: var(--card-shadow);

  backdrop-filter: blue(12px);
  -webkit-backdrop-filter: blur(12px);
}

select, input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.1rem 2rem 0.1rem 0.8rem;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

form { 
  display: flex;
  flex-direction: column;
}

#bug-emoji {
  margin: 0 auto;
  width: fit-content;
  font-size: 128px;
}

#bug-name {
  margin: 0 auto;
  width: fit-content;
  font-size: 24;
  font-weight: 700;
}
/* file: index.ts */
abstract class Bug<T> {
  emoji!: T;
  emojiElement!: HTMLParagraphElement;
  constructor(emojiElement: HTMLParagraphElement) {
    this.emojiElement = emojiElement;
  }

  abstract render(): void;
}

class Bee extends Bug<string> {
  constructor(emojiElement: HTMLParagraphElement) {
    super(emojiElement);
    this.emoji = "🐝";
  }

// User Editable Region


  override render(): void {
    this.emojiElement.innerText = this.emoji;
  }
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36

Challenge Information:

Build a Bug Emoji Picker - Step 8

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-bug-emoji-picker/692fb5ed756efe49f8531441.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hey everyone! :waving_hand: I’m stuck on Step 8 of the “Build a Bug Emoji Picker” project (Front-End Development Libraries Certification).

The task asks me to implement a render method inside the Bee class, prefixed by the override keyword, to update the innerText property of emojiElement with the value of emoji.

Here’s my current code:

class Bee extends Bug<string> {
  constructor(emojiElement: HTMLParagraphElement) {
    super(emojiElement);
    this.emoji = "🐝";
  }

  override render(): void {
    this.emojiElement.innerText = this.emoji;
  }
}

The console says: “You should set this.emojiElement.innerText to this.emoji inside the render method of Bee.” — but that’s exactly what I’m doing!

Has anyone run into this issue? What am I missing? Any help is appreciated! :folded_hands:

I went ahead and combined your posts for you. In the future, just reply to the original thread to add further updates.

okay thanks. I just implemented as the instruction said, I don’t see any mistake

Why are you defining render() as void here?

Thank you! I removed the : void return type and it worked. I didn’t realize the return type was already inferred from the abstract class declaration. Really appreciate the help!