Posts

Showing posts from November, 2022

REACT NATIVE STYLE TRICKS

  1. Layout are typicallly created with flexbox 2. flex:1 - means take all the available space       flexDirection: 'row' - means go from left to right      justifyContent, AlignItem decide how the item will allign in the axis( row, column) 3. flexDirection by default is column,     so we can put it in row flexDirection to row 4. we can also do flexDirection : row-reverse  and column-reverse [ it opposite the elements] 5. after setting the flexDirection , justifyContent,  AlignItem,- in the child view we can assign the View with flex 1, for another View we can do flex 3, so first view will take 1 hissa and second one will take 3 hissa 6. 

JS

1. function test() { return (); } or  const test = function() { return(); } or  const test =() =>{ return(); }   --Arrow function 2. var is for creating new variable, but its outdated syntax 3.  let and const are some next gen js use const when you don't want to change the variable "let is same as a var" 4. you can also add function in the js object 5. map function loop through the array and create new array - it's like for loop of javascript  6. .push is same as .append in python for adding element in array 7. array and object are primitive data type so const value can change, means we do change array and object value later after assiening them with const also 8. Rest and Spread Operator  - Spread Operator basically it pull out the items from the array and objects and put it into another object  - in Rest operator,  syntax is same as spread operator - it's like a kwargs in python, which we are using in spread operator, it takes multiple input ...