shoutem / shoutem/ui

All icons throw `Icon with name "____" not found within the provided set.`

Open
#596 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5k
Forks
451
Avg merge
1m
Merged PRs (30d)
2

Description

Issue with using the Icon component. No icons seem to exist by name, but the SVGs are provided in the assets directory.

I have tried using a react-native link multiple times to no avail.

Here is the usage:

import React, { Component } from "react";

import { NavigationBar, Icon, Title, Text } from "@shoutem/ui";
import * as Font from "expo-font";
export default class App extends Component {
  state = {
    fontsAreLoaded: false,
  };

  async _loadFonts() {
    await Font.loadAsync({
      Rubik: require("./assets/fonts/Rubik-Regular.ttf"),
      "Rubik-Black": require("./assets/fonts/Rubik-Black.ttf"),
      "Rubik-BlackItalic": require("./assets/fonts/Rubik-BlackItalic.ttf"),
      "Rubik-Bold": require("./assets/fonts/Rubik-Bold.ttf"),
      "Rubik-BoldItalic": require("./assets/fonts/Rubik-BoldItalic.ttf"),
      "Rubik-Italic": require("./assets/fonts/Rubik-Italic.ttf"),
      "Rubik-Light": require("./assets/fonts/Rubik-Light.ttf"),
      "Rubik-LightItalic": require("./assets/fonts/Rubik-LightItalic.ttf"),
      "Rubik-Medium": require("./assets/fonts/Rubik-Medium.ttf"),
      "Rubik-MediumItalic": require("./assets/fonts/Rubik-MediumItalic.ttf"),
      "Rubik-Regular": require("./assets/fonts/Rubik-Regular.ttf"),
      "rubicon-icon-font": require("./assets/fonts/rubicon-icon-font.ttf"),
    });

    this.setState({ fontsAreLoaded: true });
  }

  async componentDidMount() {
    this._loadFonts();
  }
  render() {
    if (this.state.fontsAreLoaded) {
      return (
        <NavigationBar
          centerComponent={<Title>RoomEase</Title>}
          rightComponent={<Icon name="left-arrow" />}
        ></NavigationBar>
      );
    } else {
      return null;
    }
  }
}

I assumed it may have something to do with fonts, but then realized the Icon component is just loading those SVGs, but somehow not able to find any?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Icon component and the assets directory, then reproduce the reported left-arrow usage after loading the listed fonts. Check how the provided SVG names are discovered or registered, and consider the issue resolved when an icon from the set renders without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.