vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

Percentage is now available by default #32

Closed ptomasroos closed 7 years ago

ptomasroos commented 7 years ago

Lets move the logic in order to speed up parsing https://github.com/facebook/react-native/commit/3f49e743bea730907066677c7cbfbb1260677d11

vitalets commented 7 years ago

@ptomasroos thanks for sharing. I think we should wait for RN 43 to get released and when make major release to let people keep using lib on earlier versions of RN.

X-Tender commented 7 years ago

Could it be currently used with the underscore syntax? Or are the values there precalculated too?

vitalets commented 7 years ago

@X-Tender could you show a demo what you mean?

X-Tender commented 7 years ago

Sorry I misunderstood the underscore elements. 😢

Vitaliy Potapov notifications@github.com schrieb am Fr., 7. Apr. 2017, 15:00:

@X-Tender https://github.com/X-Tender could you show a demo what you mean?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vitalets/react-native-extended-stylesheet/issues/32#issuecomment-292529868, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWTW5X7mppv3x94pc3mLV4KpDQEQ8rUks5rtjNvgaJpZM4MZWR9 .

vitalets commented 7 years ago

Never mind :)

joemckie commented 7 years ago

@vitalets it's worth noting that that commit is tagged 0.44, not 0.43 :smile:

vitalets commented 7 years ago

hi @joemckie thanks for info! I seems RN team moved this feature from 43 to 44.

X-Tender commented 7 years ago

Mmmh no? real percent values are available in RN 0.43. Or waht do you mean? :)

I fooled a bit around and changed

tryCalcPercent(str) {
  if (percent.isPercent(str)) {
    return percent.calc(str, this.prop);
  }
  return null;
}

to:

tryCalcPercent(str) {
  if (percent.isPercent(str)) {
    return str;
  }
  return null;
}

in value.js and it worked out of the box. The question is just, change the % behavior there and make it maybe a breaking change or combine it with some kind of additional property.

cyrusbowman commented 7 years ago

+1 waiting for this.

vitalets commented 7 years ago

Will try to find time for that on the nearest weekend. Btw, @X-Tender, is everything goes ok with your workaround?