kostimarko / rn-content-loader

a react native content loader without expo using react native svg
MIT License
82 stars 25 forks source link

Using render props width and height #1

Closed ogawaryu closed 5 years ago

kostimarko commented 5 years ago

Hey! Thanks for making this! Totally willing to accept this. Just curious on why you used let over const? I don't foresee reassigning width and height.

ogawaryu commented 5 years ago

let bindings are created at the top of the (block) scope containing the declaration, commonly referred to as "hoisting". Unlike variables declared with var, which will start with the value undefined, let variables are not initialized until their definition is evaluated. Accessing the variable before the initialization results in a ReferenceError. The variable is in a "temporal dead zone" from the start of the block until the initialization is processed.

kostimarko commented 5 years ago

@ogawaryu Thanks!