Skip to content

Dynamically Load Font Awesome Icon From API #165

@cblaze22

Description

@cblaze22

If we want to dynamically build a menu with icons through a web api, is it possible to reference 'faMugSaucer' as a string to a component like below?

import { View } from 'react-native'
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
import { faMugSaucer } from '@fortawesome/free-solid-svg-icons/faMugSaucer'

type Props = {}
export default class App extends Component<Props> {
  render() {
    return (
      <View>
        <FontAwesomeIcon icon={ faMugSaucer } />
      </View>
    )
  }
}```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions