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

[RCTConvert] NSString cannot be converted to NSNumber on v0.12.0 #3300

Closed
yelled3 opened this issue Oct 9, 2015 · 12 comments
Closed

[RCTConvert] NSString cannot be converted to NSNumber on v0.12.0 #3300

yelled3 opened this issue Oct 9, 2015 · 12 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@yelled3
Copy link
Contributor

yelled3 commented Oct 9, 2015

I just upgraded from v0.11.0 to v0.12.0;
After the upgrade I started getting crashes with the following error:

[RCTConvert.m:55] Error setting property 'borderColor' of RCTView with tag #1838: 
JSON value '#dddddd' of type NSString cannot be converted to NSNumber

@ide @brentvatne /cc

UPDATE
it seems react-devtools has 2 related issues:
facebook/react-devtools#223
facebook/react-devtools#214

@ide
Copy link
Contributor

ide commented Oct 9, 2015

Are you setting the border color directly on a View or using another component? If the latter you may need to update it to call processColor('#dddddd') instead.

@yelled3
Copy link
Contributor Author

yelled3 commented Oct 9, 2015

@ide yeah I was doing:

this.refs.container.setNativeProps({'borderColor': '#dddddd'});

so I should change it to?

import React from 'react-native';
import { processColor } from React;

this.refs.container.setNativeProps({'borderColor': processColor('#dddddd')});

in what other cases should I be using processColor? couldn't find it in the docs...
was this added in v0.12.0?

@brentvatne
Copy link
Collaborator

If that's necessary, I feel like setNativeProps or precomputeStyle (which is used by setNativeProps) should be updated to use processColor automatically. Can you let us know if that's required @yelled3?

@xinthink
Copy link
Contributor

xinthink commented Oct 9, 2015

Facing the same problem.
I'm trying to call processColor myself, but got undefined

const {processColor} = React;
console.log(processColor);

@wtz
Copy link

wtz commented Oct 12, 2015

use processColor works on me

@xinthink
Copy link
Contributor

Sorry, I just saw processColor exported in react-native.js of RN 0.12.0. so it should work for me either.

@yelled3
Copy link
Contributor Author

yelled3 commented Oct 12, 2015

@brentvatne

Can you let us know if that's required

yes it is :-)

If that's necessary, I feel like setNativeProps or precomputeStyle (which is used by setNativeProps) should be updated to use processColor automatically

agreed.

@skyline75489
Copy link

@xinthink I'm using 0.12.0. Why am I still getting processColor is undefined ?

@skyline75489
Copy link

And the error is not even from my own code. It's from https://github.com/corymsmith/react-native-icons/blob/master/SMXIconImage.ios.js

@jsierles
Copy link
Contributor

@facebook-github-bot answered

@facebook-github-bot
Copy link
Contributor

Closing this issue as @jsierles says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Mar 22, 2016
@renso3x
Copy link

renso3x commented Apr 13, 2017

proccessColor will be pull out from react-native.

import { processColor } from 'react-native';

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants