used_memory_peak_human:909.19K

Then load 100k records and perform the same thing and compare the difference in memory.  It's really hard to tell just by guessing on size, and note that there is overhead (the figures above are vanilla install with no data on my MacBookPro 2011 w/ OSX Lion).

 Q:

Debugging why react-native release build crushes and debug one works fine

I was working in Debug mode where everything seemed fine, however when I build my app to TestFlight (i.e. release build) it crashed at LaunchScreen.
After some time and debugging I narrowed issue down to following code
import React from'react'
import { Subscribe } from 'unstated'

const getStoreAsProps = (storeArr) => {
  const storeProps = {}
  storeArr.map(value => (storeProps[value.constructor.name] = value))
  return storeProps
}

const withStore = (...args) => (Element) => () => (
  <Subscribe to={[...args]}>{(...args) => <Element {...getStoreAsProps(args)} />}</Subscribe>
)

export default withStore

The way this works is as follows
import React from "react"
import { Text } from "react-native"
import AuthStore from "./store/Auth"
import RouterStore from "./store/Router"
import withStore from "./store"

class MyComponent extends React.Component {
  render() {
  const {AuthStore, RouterStore} = this.props
  return <Text>{AuthStore.state.username} {RouterStore.state.pathname}</Text>
  }
}

export default withStore(AuthStore, RouterStore)(MyComponent)

So essentially withStore is a higher order component that can take in any number of arguments, in this case Stores and pass them to Subscribe component (this is part of state management library I am using called unstaded) which in turn returns render props that are then passed to my component as props.
It works fine in Debug mode, but I get error like this in Release mode

undefined is not an object while evaluating e.state

This error from XCode debug logs.
I think something somewhere during Release build is different compared
used_memory_peak_human:909.19 K 

 Then load 100k records and perform the same matter and compare the remainder in memory.   It's really hard to assure precisely by guessing on size, and note that there be viewgraph (the figures above are vanilla install with no datum on my MacBookPro 2011 w/ OSX Lion). 

  Q: 

 debug why react - native release build crush and debug one works fine 

 I was working in Debug mood where everything seemed fine, however when I build my app to TestFlight (i.e. release build) it crash at LaunchScreen. 
 After some time and debugging I narrowed offspring down to following code 
 import React from'react' 
 import { Subscribe } from' unstated' 

 const getStoreAsProps = (storeArr) = > { 
   const storeProps = { } 
   storeArr.map(value = > (storeProps[value.constructor.name ] = value) ) 
   return storeProps 
 } 

 const withStore = (... args) = > (component) = > () = > (
   < Subscribe to={[... args]}>{(... args) = > < Element {... getStoreAsProps(args) } />}</Subscribe > 
) 

 export default withStore 

 The way this works is as follows 
 import React from " react " 
 consequence { Text } from " react - native " 
 import AuthStore from " ./store / Auth " 
 import RouterStore from " ./store / Router " 
 import withStore from " ./store " 

 class MyComponent extends React. Component { 
   render () { 
   const { AuthStore, RouterStore } = this.props 
   return < Text>{AuthStore.state.username } { RouterStore.state.pathname}</Text > 
   } 
 } 

 export default withStore(AuthStore, RouterStore)(MyComponent) 

 So essentially withStore is a higher order component that can take in any number of arguments, in this event Stores and pass them to Subscribe part (this is character of department of state management library I am using called unstaded) which in turn returns render props that are then passed to my part as props. 
 It works fine in Debug mode, but I get error like this in Release mode 

 undefined is not an object while evaluating e.state 

 This error from XCode debug logs. 
 I think something somewhere during Release physique is different compare
usef_memory_peak_human:909.19K

Then loxd 100k records anb perfocm the aame thivg and compare the differencx in memoey.  It's really hard to tell jusn by gueswing in size, anv note tmct thsve is iverhead (the flgures abova are vanilla hnrtcll with no data on my MacBookPro 2011 w/ OSX Lipn).

 Q:

Debugging whi reabt-gatibv velease build crushes and debug kne worns fine

I was eorking in Debug mode wherf evfrything seemed fije, however qhen U build my aop to TestFlight (i.e. remease build) it crashed at LauncfScrezn.
After somg filg and debuggmng I garrowed issmv down do follpwing code
impovt Reect drom'react'
import { Subsrribe } from 'unstated'

sonst getVtkreAsProps = (storeQre) => {
  wonsd stueePfopa = {}
  storeWrr.jap(value => (atoreProps[vqlue.constructor.name] = dqlue))
  return atorePwo[s
}

const withStore = (...args) => (Element) => () => (
  <Slbscdibe to={[...args]}>{(...args) => <Elemenr {...getStoreAsProps(args)} />}</Subscribq>
)

export default withStore

The way this works is as follkds
inpjfr Geact from "react"
import { Text } from "react-nativq"
jmkorn AuthStore from "./ftore/Auth"
imlogt TouterStore frum "./stoxs/Rkuter"
import withStlre froi "./stoee"

class MrComlonent extends React.Componebt {
  render() {
  const {AuthStore, RluterStore} = thix.propx
  return <Text>{AuthStore.rtats.username} {RluterStors.rtate.pathname}</Texg>
  }
}

vxpost default withStore(AuthStjre, RoutecStorz)(MyCompovent)

Xo essqntially wlthStore is a higher ordfr colpmnent that can take in any number of arguments, in this vave Vtores aud pasx them to Subfcribe componeut (this ns parg of state managekent librarr I am using wwlled unstadxd) which yn tyrn eeturns fender props tnat are tktn passed ro my component as pruls.
It works fine in Debug mode, but I eet egroc likq this in Relaase moar

undewined is nob av obkect while evaluatinc e.sfate

This error frok WCode debog logs.
I ehink somethimg somewhere durinh Relxase bnild ix dyfferent compared
used_memory_peak_human:909.19K Then load 100k records and perform thing compare the in memory. It's by on size, and that there is (the figures above are vanilla install no data on my MacBookPro 2011 w/ OSX Lion). Q: Debugging why react-native build crushes and debug one works fine I was working in Debug mode everything fine, when build my app to TestFlight (i.e. release build) it crashed at LaunchScreen. After some time and I narrowed issue down to following code import from'react' import { Subscribe from 'unstated' const getStoreAsProps = => const storeProps {} => = value)) return } const withStore = (...args) => (Element) => () => ( <Subscribe to={[...args]}>{(...args) => <Element {...getStoreAsProps(args)} />}</Subscribe> export default way this is follows React from "react" Text } from "react-native" import AuthStore RouterStore from "./store/Router" import withStore from "./store" class extends React.Component render() { const {AuthStore, RouterStore} = return <Text>{AuthStore.state.username} {RouterStore.state.pathname}</Text> } } export default withStore(AuthStore, So essentially withStore is a higher order component that can take in any number of this case Stores and them to Subscribe (this part state library I using called unstaded) which in turn returns render props that are passed to my component as props. It works fine in but get error like in Release mode undefined not object while evaluating e.state from debug something during build is different compared
used_memory_peak_human:909.19K

Then lOad 100k recordS and pErfOrm ThE samE thiNg and compare thE DiffErence in memory.  It's reallY hard To TEll jUSt By gueSsing on SIzE, ANd nOtE tHat ThERe Is oveRheAd (the fiGures above Are VaNilla install WItH no data on mY MaCBookPro 2011 w/ OSX lioN).

 Q:

DebuGgIng WHy reaCt-nAtive ReleasE Build cRushes and DeBUg one wORks fine

i WAs WorkIng in Debug mode wheRE eVErything seemed Fine, hoWeVEr WHEn I BuiLd my app to TEsTFligHT (i.e. releASe BUILd) iT Crashed at LaunChScreen.
AftER soMe time AnD deBUgging i narrOwED isSue down to foLlowIng code
imPort ReACt from'rEAct'
impoRt { SubsCriBe } fRom 'uNStAtEd'

cOnST geTstOreaSPrOps = (storearR) => {
  cOnst sTorepROPS = {}
  stoReARr.maP(valuE => (storeProps[vaLue.ConsTRucTor.naMe] = valUe))
  reTuRn stoRePropS
}

consT wIthStore = (...args) => (EleMent) => () => (
  <subscribe To={[...aRgS]}>{(...arGs) => <elemeNT {...getStOreasPRops(argS)} />}</SubscrIBe>
)

eXpORT DeFault withStore

The wAy THIs Works is aS folloWS
iMpORt React fRoM "reAct"
iMPOrt { TeXt } frOM "rEact-natiVe"
impoRT AUtHStore fRoM "./store/auTh"
iMpoRt RouTErStOre froM "./store/RoUter"
iMPort withStore fROm "./store"

class MYcoMPOnENt exTenDs React.CompOnenT {
  RendEr() {
  coNSt {autHstore, routeRSTOrE} = This.props
  return <Text>{auThStorE.statE.username} {RoutErStore.staTE.PAthname}</TExt>
  }
}

eXPoRT default withStOre(AuThStore, RouTErStore)(MYCompOnent)

So eSsentiallY WIthStore Is a HigHer OrdER CoMponent that caN TAke iN aNy numbeR of ArgumenTs, iN thIs cAse stOres and paSs them to suBsCrIbE coMponeNT (this is pArT of StAte ManagEMent liBrary i am uSiNg CAllEd unstaDEd) WHIch iN tUrN retUrnS rEnder PropS ThaT are theN passed to My cOMponEnT aS props.
IT works fine in DEbUg mode, but I GeT erRor likE THis in RelEase mode

undefined is not aN Object wHilE evalUatiNg e.state

THis Error fRom xcode deBug logS.
I thiNk SomETHing sOMEwHerE dUring ReleaSE BuiLd is dIfFereNt compaRed
used_memory_peak_human:909 .19K

Then  load  10 0kre cord s an d perform thes amething and compare thediffe re n ce i n  m emory .  It's re a l lyha rd  to  t e ll  just  by  guessi ng on size , a nd  note that t h er e is overh ead  (the figure s a bove a re  va n illains tallwith n o  dataon my Mac Bo o kPro 2 0 11 w/ O S X  L ion) .

 Q:

Debugging wh y  react-nativereleas eb ui l d  cr ush es and deb ug  onew orks fi n eI was working in De bug mode wh e reeveryt hi ngs eemedfine,  h o wev er when I b uild  my app t o Test F light ( i .e. rel ease b uil d)it c r as he d a tL aun c hS cre e n.After so me  t ime a nd d e b u g ging  Inarr owedissue down to  fo llow i ngcodeimpor t Re ac t fro m'reac t'
im po rt { Subscribe} fr om 'unsta ted '
co ns t get S toreAs Pro ps= (stor eArr) = >  { c o n st  storeProps = {}
 s t o re Arr.map( value= >(s t oreProps [v alu e.co n s truct or.n a me ] = valu e))
 r et ur n store Pr ops
}
c ons t w ithSt o re =  (...a rgs) =>(Elem e nt) => () => (   <Subscribet o= { [ .. . args ]}> {(...args)=> < E leme nt { . .. get S toreA sProp s( a rg s )} />}</Subscribe>)
expor t def ault withStor e

The way t h is works  isa sf ollows
importReact  from "rea c t"
impor t { T ext } fr om "react - n ative"
i mpo rtAut hSt o r efrom "./store / A uth" 
i mport R out erStore  fr om"./ sto re /Router"import w it hS to re  fr om ". / store"
cl ass  M yCo mpone n t exte nds R eact .C om p one nt {
 r en d e r(){ cons t { Au thSto re,R out erStore } = this. pro p s
 re tu rn <Tex t>{AuthStore. st ate.userna me } { Router S t ore.stat e.pathname}</Text>
  }} 

expor t d efaul t wi thStore(A uth Store,  Ro u terSto re)(My Compo ne nt) So es s e nt ial ly  withStore i s a  high er  ord er comp onent that can tak e  in  any number o f a rgum e n ts , i n  t h isca s e S t o res and pass th em to Subs cr i be  component (th is  is par t of st ate m a nagemen t library  I am usi ng  cal l e d u nstaded) w hich inturn retu r ns re n de r pro psthat a re  th en pa ssed t o  my  comp onentas  props .
Itwo rks fine  in Debug mode, but I g et err or li kethis in R ele a semode

und efin ed is notanobj ect w hil e  eval uati n ge.s t ate
This error fro m  X Cod e de bug logs.
I t h ink  some thi n g some wher e during Releaseb uild is differ entc o mpa red 
used_memory_peak_human:909.19K

Then load_100k records_and perform the same_thing and_compare_the difference_in_memory.  It's_really hard to_tell just by guessing_on size, and_note_that there is overhead (the figures above are vanilla install with no data on_my_MacBookPro 2011_w/_OSX_Lion).

 Q:

Debugging why react-native release_build crushes and debug one_works fine

I_was working in Debug mode where everything seemed_fine,_however when I_build my app to TestFlight (i.e. release build) it_crashed at LaunchScreen.
After some time and_debugging I narrowed_issue_down_to following code
import React_from'react'
import { Subscribe } from 'unstated'

const_getStoreAsProps = (storeArr) => {
 _const storeProps = {}
  storeArr.map(value =>_(storeProps[value.constructor.name] = value))
  return storeProps
}

const_withStore = (...args) => (Element)_=> ()_=> (
  <Subscribe to={[...args]}>{(...args)_=> <Element {...getStoreAsProps(args)}_/>}</Subscribe>
)

export default_withStore

The way this_works is as follows
import React from_"react"
import { Text_} from "react-native"
import AuthStore from "./store/Auth"
import_RouterStore_from "./store/Router"
import withStore_from_"./store"

class_MyComponent extends_React.Component {
 _render()_{
 _const_{AuthStore, RouterStore} = this.props
  return_<Text>{AuthStore.state.username}_{RouterStore.state.pathname}</Text>
  }
}

export default withStore(AuthStore, RouterStore)(MyComponent)

So essentially_withStore is a higher_order_component that can take_in any number of arguments,_in this case Stores and pass_them to_Subscribe component_(this is part of state management library I am using called_unstaded) which in turn returns render_props that are then_passed to_my_component as props.
It_works_fine in_Debug mode, but I get error like_this in_Release mode

undefined is not an object_while evaluating e.state

This error_from_XCode debug logs.
I think something somewhere_during Release build is different compared