Coder Social home page Coder Social logo

vector-icons's Introduction

@expo/vector-icons

This library is a compatibility layer around @oblador/react-native-vector-icons to work with the Expo asset system. If you're using React Native without Expo, you have no need for this library -- carry on! (or maybe check out Expo).

๐Ÿ‘€: this library does not provide access to react-native-vector-icon's Icon.getImageSource() function for generating images from icons at runtime (for context on why, see this issue). If you find yourself needing an icon in the form of an image rather than text, you should generate that image yourself and bundle it with your app.

Resources

Screenshot of website

Usage

This library is part of the expo package, so if you are using expo you can simply use it like so

import React from 'react';
import Ionicons from '@expo/vector-icons/Ionicons';

export default class IconExample extends React.Component {
  render() {
    return <Ionicons name='md-checkmark-circle' size={32} color='green' />;
  }
}

for more usage see Expo icons documentation

Maintainers

How to upgrade the react-native-vector-icons version

I'll be honest with you, it's not straightforward. You should set aside about an hour to do this.

  1. Clone react-native-vector-icons
  2. Copy files from the cloned directory into src/vendor/react-native-vector-icons, except the dotfiles.
  3. Run git status and look at the untracked files. Remove anything that doesn't seem needed. For example, remove package.json, react-native.config.js, react-native.osx.js. Things to look out for are new icon fonts or new create-* files.
  4. Run git diff **/*.js - do any of the changes look like they should be synced over to the equivalent .ts files in src?/
  • ToolBarAndroid and TabBarIOS are not included in @expo/vector-icons
  • Neither are the native vendor font loading or image source related methods.
  • Probably there won't be anything important. The main thing to look out for are user-facing API changes, the @expo/vector-icons internals are different enough that you don't need to worry about it.
  • Were any dependencies added? Check imports against those in the current package.json, see why they were added - maybe they support the bin scripts, in which case we need them.
  • TypeScript/Flow types for Icon/Icon.Button components may need to be updated.
  1. Run yarn when you're done and it'll copy vendor files over to build.
  2. Go to the website directory, test it out by changing the @expo/vector-icons version to "../" (TODO: investigate this quirk!). If new icons were added, ensure that they work here.
  • While you're here, it would be kind of you to update the Expo SDK version to latest.
  1. Publish an alpha release, switch back the version in the website to that version.
  2. Open a PR, have someone else like @brentvatne look at it. If it's good to go, publish the final version, update the website version again, then merge. The website will be deployed when you merge to master.

How to deploy the website

Create a commit on master.

vector-icons's People

Contributors

aasfga avatar arlen22 avatar atiladev avatar brentvatne avatar cruzach avatar cyprusglobe avatar danielholmes avatar daxaxelrod avatar dependabot[bot] avatar evanbacon avatar expbot avatar ide avatar jonsamp avatar morenoh149 avatar mvanroon avatar overvlad avatar pveyes avatar raajnadar avatar ro-savage avatar simek avatar terribleben avatar tylerc avatar wschurman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vector-icons's Issues

Can only update a mounted or mounting component : Icon component

Hello,
I've got a strange error :

Warning: Can only update a mounted or mounting comopnent. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.

Please check the code for the Icon component.

For this code

class Root extends React.Component {
    private label = <View><FontAwesome name="*myIcon*" /> <Text>Hello</Text></View>;

    render() {
        return (
            {this.props.show ? this.label : undefined}
        );
    }
}

But this code doesn't emit any warning :

class Root extends React.Component {
    private label = <View><FontAwesome name="*myIcon*" /> <Text>Hello</Text></View>;

    render() {
        return (
            {label}
        );
    }
}

Is it normal ? How can we fix this ?

Invalid prop type

Warning:
[exp] Warning: Failed prop type: Invalid prop name of value puzzle-piece supplied to Icon, expected one of ["ios-add","ios-add-circle","ios-add-circle-outline","ios-add-outline","ios-alarm","ios-alarm-outline","ios-albums","ios-albums-outline","ios-alert","ios-alert-outline","ios-american-football","ios-american-football-outline","ios-analytics","ios-analytics-outline","ios-aperture","ios-aperture-outline","ios-apps","ios-apps-outline","ios-appstore","ios-appstore-outline","ios-archive","ios-archive-outline","ios-arrow-back","ios-arrow-back-outline","ios-arrow-down","ios-arrow-down-outline","ios-arrow-dropdown","ios-arrow-dropdown-circle","ios-arrow-dropdown-circle-outline","ios-arrow-dropdown-outline","ios-arrow-dropleft","ios-arrow-dropleft-circle","ios-arrow-dropleft-circle-outline","ios-arrow-dropleft-outline","ios-arrow-dropright","ios-arrow-dropright-circle","ios-arrow-dropright-circle-outline","ios-arrow-dropright-outline","... [it lists all the icons that begin with ios and md]

I'm trying to use an FA icon from the directory and am getting this error.

How to remove padding from vector icons in Expo

If i use the vector icons in Expo i see lot of padding space is added around the icon by default. [Green color in the screenshot attached, thats the padding for a 15px icon]. Is there a way to remove that extra padding? Tried manual overriding of padding and margin but didn't worked. Sample code for the screenshot provided:
<Entypo name="triangle-down" size={15} color="#9013FE" style={{ backgroundColor: 'green', }}/>

7ywqb

Warning on createIconSetFromIcoMoon

When updating to the latest Expo version, I got this error:

`Expo.Font.style() is deprecated and will be removed in SDK 24. After loading a font with a specified name with Font.loadAsync, you can just reference that font in the fontFamily of your component's style.

  • node_modules/expo/src/Font.js:133:2 in style
  • node_modules/@expo/vector-icons/createIconSetFromIcoMoon.js:5:53 in default`

Do I have to change something?

Style not working

Hello,
I am trying to add style to icon but it has no effect :

<FontAwesome name={link.icon} size={18} style={{marginRight: 15}} />

Is it normal ?

Error when using in combination with Jest

This issue might be related to #39 - I'm running into trouble with a similar setup. For some reason, Jest is unable to load vector-icons correctly.

The error is slightly different, but the problem goes away when I remove vector-icons from the file it's used in.

"@expo/vector-icons": "^6.3.1",
"expo": "^27.0.1",
"jest-expo": "~27.0.0",

Error message:

TypeError: TaskQueue: Error with task : Cannot read property 'Object.<anonymous>' of null
    at Runtime._execModule

The test itself is simple:


import React from 'react';
import App from '../App';

import renderer from 'react-test-renderer';

describe('<App />', () => {
  it('renders correctly', () => {
    const rendered = renderer.create(<App />).toJSON();
    expect(rendered).toMatchSnapshot();
  });
});

Is anyone else experiencing this issue as well?

Icons not being shown in detached project

Hi!,

When i make a release version in my IOS App the icons dont show up. This happens in my iphone and the simulator. If i run it in debug variant it works fine.

Any thought?

Error when using vector-icons component in Jest test with Expo 25

I just upgraded to Expo 25, and updated react-test-renderer to 16.2.0 to match the updated React version.

A while back when I first added tests for my components that included components from expo/vector-icons, there were the sorts of transform-related errors that I typically see with Jest tests, and I added the package to transformIgnorePatterns in the jest section in package.json and the errors went away:

"jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!react-native|@shoutem/theme|@shoutem/animation|@shoutem/ui|tcomb-form-native|native-base-shoutem-theme|react-navigation|@expo/react-native-action-sheet|expo|@expo/vector-icons)"
    ]
  },

(see the last match)

As of Expo 25, I now get another error related to the vector-icons library:

    /path/to/my/app/node_modules/@expo/vector-icons/fonts/Entypo.ttf:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){
                                                                                             
    
    SyntaxError: Invalid or unexpected token
      
      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:318:17)
      at Object.<anonymous> (node_modules/@expo/vector-icons/Entypo.js:4:55)
      at Object.get Entypo [as Entypo] (node_modules/@expo/vector-icons/index.js:3:8)

For good measure, I tried running jest with --no-cache, but got the same error. Given I've already got expo/vector-icons in my transformIgnorePatterns, I'm not real sure what to do with this, and wondering if anyone has any other ideas. Thanks!


Just to try to see what happens for comparison...

If I remove @expo/vector-icons from transformIgnorePatterns and run Jest with the --no-cache flag, I get (what I believe is) the original error that prompted me to add it in the first place:

/path/to/my/app/node_modules/@expo/vector-icons/Entypo.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import glyphMap from './vendor/react-native-vector-icons/glyphmaps/Entypo.json';
                                                                                             ^^^^^^
    
    SyntaxError: Unexpected token import

      74 | 
      75 | const PressOptionChevronIcon = () => (
    > 76 |   <Entypo name="chevron-thin-right" size={14} color={colors.secondaryText} />
      77 | );
      78 | 
      79 | export {
      
      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:318:17)
      at Object.get Entypo [as Entypo] (node_modules/@expo/vector-icons/index.js:3:12)
      at PressOptionChevronIcon (app/config/common-icons/index.js:76:43)
      at mountIndeterminateComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3815:15)
      at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:4004:16)
      at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6007:16)

AntDesign doesn't work

I wanna use exclamation icon of AntDesign, but a error occurs when I use AntDesign from @expo/vector-icons

import { AntDesign } from "@expo/vector-icons";
...

<AntDesign name="exclamationcircle" />

...

Error message

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot toexport your component from the file it's defined in, or you might have mixed up default and named imports.

Check your code at INI_01_1.js:191.
    in NameInput (at INI_01_1.js:92)
    in RCTView (at View.js:60)
    in View (at INI_01_1.js:133)
    in _class2 (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:481)
    in RCTView (at View.js:60)
    in View (at createAnimatedComponent.js:154)
    in AnimatedComponent (at screens.js:51)
    in Screen (at StackViewCard.js:41)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:505)
    in RCTView (at View.js:60)
    in View (at screens.js:76)
    in ScreenContainer (at StackViewLayout.js:399)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:398)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:40)
    in RCTView (at View.js:60)
    in View (at Transitioner.js:141)
    in Transitioner (at StackView.js:19)
    in StackView (at createNavigator.js:59)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:481)
    in RCTView (at View.js:60)
    in View (at createAnimatedComponent.js:154)
    in AnimatedComponent (at screens.js:51)
    in Screen (at StackViewCard.js:41)
    in Card (at createPointerEventsContainer.js:26)
    in Container (at StackViewLayout.js:505)
    in RCTView (at View.js:60)
    in View (at screens.js:76)
    in ScreenContainer (at StackViewLayout.js:399)
    in RCTView (at View.js:60)
    in View (at StackViewLayout.js:398)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:40)
    in RCTView (at View.js:60)
    in View (at Transitioner.js:141)
    in Transitioner (at StackView.js:19)
    in StackView (at createNavigator.js:59)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at setup.js:7)
    in Setup (at App.js:6)
    in App (at registerRootComponent.js:35)
    in RootErrorBoundary (at registerRootComponent.js:34)
    in ExpoRootComponent (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)
- node_modules/fbjs/lib/warning.js:33:20 in printWarning
- node_modules/fbjs/lib/warning.js:57:25 in warning
- node_modules/react/cjs/react.development.js:1291:12 in createElementWithValidation
* src/components/pages/Register/INI_01_1.js:191:9 in NameInput
- node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js:9050:17 in mountIndeterminateComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js:12924:25 in performUnitOfWork
- ... 16 more stack frames from framework internals

Other icons work normally (e.g. Feather)

Mission fonts

I've noticed that a lot of the fonts listed in the direct seem to be missing. For example when it try to render chevron-right i get an ? and an "Invalid Prop name" console error.

---Console Error----
Warning: Failed prop type: Invalid prop name of value chevron-left supplied to Icon, expected one of ["ios-add","ios-add-circle","ios-add-circle-outline","ios-add-outline","ios-alarm","ios-alarm-outline","ios-albums","ios-albums-outline","ios-alert","ios-alert-outline","ios-american-football","ios-american-football-outline","ios-analytics","ios-analytics-outline","ios-aperture","ios-aperture-outline","ios-apps","ios-apps-outline","ios-appstore",......

Am I missing step?

Icons centered ?

Yo ! I'm using expo and this lib to render icon component and I find that the icons are not vertically centered. Maybe I'm using it wrong, but even if I render just the Icon component and put his background color to see better, the icon is clearly not centered.

image

import { Ionicon } from '@expo/vector-icons'

<Ionicon
  color='white'
  name='close'
  style={ย { backgroundColor: 'red' }ย }
/>

I tried to put alignItems: 'center' and justifyContent: 'center' to style without success...

If I put paddingTop: 2 to style, the icon is centered

image

Breaks icons in v6.2.0

Updating from v6.1.0 to v6.2.0 breaks vector icons.

screen shot 2017-11-14 at 10 44 56 am

I've since rolled back to 6.1.0 without an issue.

Incompatibility issue with react-native-elements

When I attempt to add react-native-elements to my expo project (specifically working with the List component), it gives an error that fontFamily 'Material Icons' is not a system font:

screen shot 2017-04-07 at 3 02 54 pm

It can easily be resolved by switching the imports within react-native-elements to point to this package, for example:

change this
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
to
import MaterialIcon from '@expo/vector-icons/MaterialIcons'

Is there an official (or better) way to do this? I am new to expo/RN and was unable to find any documentation

icons don't display when using clojurescript

I can't seem to find out how to use the icons from ClojureScript.

The app loads in the Genymotion virtual device but the icons show tofu (the rectangle).

genymotion for personal use - google nexus 5x - 7 1 0 - api 25 - 1080x1920 1080x1920 420dpi - 192 168 56 101_010

This is the minimal example I was using, basically the expo lein template plus a few lines to load the icons.

I added the lib with `yarn add "@expo/vector-icons", and package.json has

"@expo/vector-icons": "^6.3.1",

core.cljs

(ns app.core
    (:require [reagent.core :as r :refer [atom]]
              [re-frame.core :refer [subscribe dispatch dispatch-sync]]
              [app.handlers]
              [app.subs]))

(def ReactNative (js/require "react-native"))
(def Expo (js/require "expo"))
(def Font (.-Font Expo))

(def VectorIcons (js/require "@expo/vector-icons"))
(def FontAwesome (.-FontAwesome VectorIcons))
(def <fontawesome-icon> (r/adapt-react-class FontAwesome))
(def MaterialIcons (.-MaterialIcons VectorIcons))
(def <material-icon> (r/adapt-react-class MaterialIcons))

(def app-registry (.-AppRegistry ReactNative))
(def text (r/adapt-react-class (.-Text ReactNative)))
(def view (r/adapt-react-class (.-View ReactNative)))
(def image (r/adapt-react-class (.-Image ReactNative)))
(def touchable-highlight (r/adapt-react-class (.-TouchableHighlight ReactNative)))
(def Alert (.-Alert ReactNative))

(defn alert [title]
  (.alert Alert title))

(defn app-root []
  (let [greeting (subscribe [:get-greeting])]
    (fn []
      [view {:style {:flex-direction "column" :margin 40 :align-items "center"}}
       [image {:source (js/require "./assets/images/cljs.png")
               :style {:width 200
                       :height 200}}]
       [text {:style {:font-size 30 :font-weight "100" :margin-bottom 20 :text-align "center"}} @greeting]

       [<fontawesome-icon> {:name "camera"}]
       [<material-icon> {:name "camera"}]

       [touchable-highlight {:style {:background-color "#999" :padding 10 :border-radius 5}
                             :on-press #(alert "HELLO!")}
        [text {:style {:color "white" :text-align "center" :font-weight "bold"}} "press me"]]])))

(defn init []
  (dispatch-sync [:initialize-db])
  (.registerComponent app-registry "main" #(r/reactify-component app-root)))

Warn or throw error for tab bar icon

expo/vector-icons doesn't play nicely with TabBarIOS because 1) we don't recommend using it, JS solution is cross-platform and more customizable 2) we don't want to add the native module necessary to make it play nicely to Exponent.

So we should make it very clear whenever someone tries this that it will not work

Error: Unable to resolve module @expo/vector-icons/glyphmaps/Entypo.json

UnhandledPromiseRejectionWarning:Unhandled promise rejection (rejection id: 1632): 
UnableToResolveError: Unable to resolve module @expo/vector-icons/glyphmaps/Entypo.json
from /home/user/Development/app/node_modules/@expo/vector-icons/Entypo.js:
Module does not exist in the module map or in these directories: 
/home/user/Development/app/node_modules/@expo/vector-icons/glyphmaps

This started happening when I changed from exponent to expo. With the exponent namespace everything is working fine

'RCTBridgeModule.h' file not found

SDK27, exp --version 55.0.5

% react-native link
...
Platform 'ios' module @expo/vector-icons has been successfully linked
...

At build with Xcode 9.2, I have the build error in Librairies/RNVectoricons.xcodeproj/RNVectorIconsManager/RNVectorIconsManager.h :

'RCTBridgeModule.h' file not found

Error: Unable to resolve module `./fonts/Ionicons.ttf

I've a project create with react-native-cli and I've installed native-base library for UI elements.
native-base star asking me to install @expo/vector-icons to work:

error: bundling failed: "Unable to resolve module @expo/vector-icons/Ionicons from C:\\Code\\ReactNativeProjects\\CaliUp\\node_modules\\native-base\\dist\\src\\basic\\IconNB.js: Module does not exist in the module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n 1. Clear watchman watches: watchman watch-del-all.\n 2. Delete the node_modules folder: rm -rf node_modules && npm install.\n 3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache."

After I've installe the expo package the app still doesn't work, giving me the following error:

error: bundling failed: "Unable to resolve module ./fonts/Ionicons.ttf from C:\\Code\\ReactNativeProjects\\CaliUp\\node_modules\\@expo\\vector-icons\\Ionicons.js: could not resolve `C:\Code\ReactNativeProjects\CaliUp\node_modules\@expo\vector-icons\fonts\Ionicons.ttf' as a folder: it did not contain a package, nor an index file"

This is my package.json file:

This is my package-json:

 {
   "name": "CaliUp",
   "version": "0.0.1",
   "private": true,
   "scripts": {
     "start": "node node_modules/react-native/local-cli/cli.js start",
     "test": "jest"
   },
   "dependencies": {
     "@expo/vector-icons": "^5.0.0",
     "native-base": "^2.2.1",
     "react": "16.0.0-alpha.12",
     "react-native": "0.46.4",
     "react-native-vector-icons": "4.1.1",
     "react-navigation": "^1.0.0-beta.11"
   },
   "devDependencies": {
     "babel-jest": "20.0.3",
     "babel-preset-react-native": "2.1.0",
     "jest": "20.0.4",
     "react-test-renderer": "16.0.0-alpha.12"
   },
   "jest": {
     "preset": "react-native"
   }
 }

How can I solve that?

Rename all fonts to use their names in react-native-vector-icons?

Okay, so, this is actually the same issue as #9; it's not being resolved by a PR, the issue is still there, I'm using the latest CRNA/expo(v17) combo.

I think this issue can be easily mitigated by renaming all fonts to use their names inside the original react-native-vector-icons; ie. you will wanna change this from 'material' to 'Material Icons', etc. etc.

May we discuss why their names in this repo deviated from their original names and, if it will cause any harm to change them back? Thanks!

Unable to run Material Icons

I am trying to include Material Icons with my Expo setup and just get the same error;

simulator screen shot - iphone 6s - 2018-03-16 at 00 20 02

My App.js looks like this;

import React from 'react'
import { Font, AppLoading } from 'expo'
import { MaterialIcons } from '@expo/vector-icons'
import HybridApp from './src/App'

export default class NativeApp extends React.Component {
  constructor() {
    super()
    this.state = {
      fontsAreLoaded: false
    }
  }
  async componentWillMount() {
    await Font.loadAsync(MaterialIcons.font)
    this.setState({ fontsAreLoaded: true })
  }
  render() {
    const { fontsAreLoaded } = this.state
    return !fontsAreLoaded ? <AppLoading /> : <HybridApp />
  }
}

I am waiting to for the fonts to be loaded. Nothing doing :(

Feather not working

Feather icons are not working

Error :

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.

Check the render method of StaticRenderer.

instantiateReactComponent
ReactNativeStack-dev.js:1960:75
instantiateChild
ReactNativeStack-dev.js:2702:86
traverseStackChildrenImpl
ReactNativeStack-dev.js:2669:215
traverseStackChildrenImpl
ReactNativeStack-dev.js:2673:101
instantiateChildren
ReactNativeStack-dev.js:2709:39
_reconcilerInstantiateChildren
ReactNativeStack-dev.js:2843:121
mountChildren
ReactNativeStack-dev.js:2865:59
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
performInitialMountWithErrorHandling
ReactNativeStack-dev.js:1687:46
mountComponent
ReactNativeStack-dev.js:1655:87
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
mountChildren
ReactNativeStack-dev.js:2871:62
initializeChildren
ReactNativeStack-dev.js:2940:45
mountComponent
ReactNativeStack-dev.js:2969:84
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54
mountComponent
ReactNativeStack-dev.js:1655:184
mountComponent
ReactNativeStack-dev.js:1327:53
performInitialMount
ReactNativeStack-dev.js:1703:54

Example Code :

is attached
result.js.txt

star-o icon

The star-o icon doesn't seem to exist, despite being listen on https://expo.github.io/vector-icons/.

(Same goes for the star-off & star-outline icons)

Code:

<MaterialIcons name="star-o" size={22} />

Version: 6.3.1
Error:

Warning: Failed prop type: Invalid prop `name` of value `star-o` supplied to `Icon`, expected one of 
["3d-rotation",
 ...
 "spellcheck","star","star-border","star-half","stars","stay-current-landscape"
 ...
]

TabNavigator Icon with React Navigation

I'm trying to implement a TabNavigator using React-Navigation.

In order to add a tab, following the documentation, i'm doing this :

class MyHomeScreen extends React.Component {
  static navigationOptions = {
    tabBarLabel: 'Home',
    tabBarIcon: ({ tintColor }) => (
      <Image
        source={require('./chats-icon.png')}
        style={[styles.icon, {tintColor: tintColor}]}
      />
    ),
  };

  render() {
    return (
      ...
    );
  }
}

I did try to replace the Image Component with FontAwesome such as :

import { FontAwesome } from '@expo/vector-icons';
 static navigationOptions = {
    tabBarIcon: ({ tintColor }) => (
      <FontAwesome name="user" size={32} color="tintColor" />
    ),
  };

But i only have my label.

Stackoverflow link : https://stackoverflow.com/questions/48429649/tabnavigator-with-expo-vector-icons

Issues with showing local images & icons after upgrade to 6.2.0 from 6.1.0

Hello everyone.

Yesterday I upgraded our apps from Expo SDK 22 to 23 and with that also updated all the other dependencies. One of those was @expo/vector-icons from 6.1.0 to 6.2.0.

It worked fine when developing locally and all my icons and images kept showing, however once I did exp publish the images didn't show anymore and the icons were replaced with characters of asian origin. And no errors are produced that would lead me anywhere.

screenshot_20171130-130537

Can you think of a way that any of the diffs between 6.1.0 and 6.2.0 would also mess with the images not showing anymore? Given that I only see the characters leads me to assume that the font hasn't been loaded yet (20s after starting the app on wifi) - @brentvatne or is there any possibility that there are issues with the assets being put on cloudfront using this new version?

The app I'm mentioning is expo.io/@flyerbee/flyapp-lite (which currently uses 6.1.0) and expo.io/@flyerbee/flyapp-lite-staging (expo release number 1.0.0-r.djrqv6nDoo which just now uses 6.2.0) and if it's any help the source code is private but i can give access if it'd be any help.

I'm grateful for any leads anyone might have. Thank you

Error: Unable to resolve module ./fonts/Entypo.ttf (@exponent/vector-icons)

Having this issue with latest @exponent/vetor-icons v4.0.0
Tested w/ @expo/ex-navigation v2.9.2 and @exponent/ex-navigation v2.9.1

Code: example NavigationDrawer

Error Message:Unable to resolve module ./fonts/Entypo.ttf (@exponent/vector-icons)

I have also installed react-native-vector-icons which includes the Entypo library...

Unable to load icons in a CRNA app

I've just created a create-react-native-app, and I'm attempting to set up react-native-material-ui with it. I installed @expo/vector-icons, but attempting to use it produces a load error:

import { MaterialIcons } from '@expo/vector-icons/MaterialIcons'

3:24:12 PM: (node:19593) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 12249): UnableToResolveError: Unable to resolve module ./fonts/MaterialIcons.ttf from /home/chris/projects/wendling/node_modules/@expo/vector-icons/MaterialIcons.js: Directory /home/chris/projects/wendling/node_modules/@expo/vector-icons/fonts/MaterialIcons.ttf doesn't exist

But it definitely exists:

$ file /home/chris/projects/wendling/node_modules/@expo/vector-icons/fonts/MaterialIcons.ttf
/home/chris/projects/wendling/node_modules/@expo/vector-icons/fonts/MaterialIcons.ttf: TrueType font data

I'm just dipping my toes into React Native and Expo so it's possible this is just newbie error, but I'm at a loss to explain what. Any pointers?

Impossible to resolve module for RN 0.47

Hello,

When I want to use the plugin for react native 0.47, I did the react-native link and add the line "apply ..." for the "react-native-vector-icons"
But i have a problem with red screen that the module with MaterialCommunityIcons.ttf is not found, maybe not package nor index file... and in the error message there is "@expo" so i think that it this repo that doesn't work well...

Please help me :(
Sincerely,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.