Passing props into external stylesheet in React Native?

后端 未结 4 1378
臣服心动
臣服心动 2020-12-16 14:08

I\'m new to React and React Native. At the moment for each component I\'m breaking the code into 2 separate files:

  1. index.js for all the React cod
4条回答
  •  离开以前
    2020-12-16 14:30

    i'm sending noFooter boolean prop in a style sheet

       
          Testing 
        
    

    and receiving it like

      mainFooterCont: noFooter => ({
       flexDirection: 'row',
       justifyContent: 'space-between',
       alignItems: 'flex-end',
       paddingBottom: noFooter ? 0 : 20,
       paddingTop: Metrics.ratio(noFooter ? 0 : 5),
       }),
    

提交回复
热议问题