moh3n9595 / react-native-dynamic-render

🔀 Render from Json object
MIT License
11 stars 2 forks source link

Flatlist component #13

Open GlenIntoBeyond opened 2 years ago

GlenIntoBeyond commented 2 years ago

What you did: Trying to output the flatlist component @moh3n9595

What happened: No output

const DATA = [
  {
    _uid: 'bd7acbea-c1b1-46c2-aed5-3ad53abb28ba',
    title: 'First Item',
  },
  {
    _uid: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63',
    title: 'Second Item',
  },
  {
    _uid: '58694a0f-3da1-471f-bd96-145571e29d72',
    title: 'Third Item',
  },
];

Below this is inside a json object

    {
      name: "flatList",
      _uid: "00",
      props: {
        data: {DATA},
        renderItem:(({item})=>
          (
            {
              name: "view",
              _uid: "22",
            children: [
              {
                name: "text",
                _uid: "23",
                children: item.title,
                props: {
                  numberOfLines: 1,
                  ellipsizeMode: 'tail',
                  style: {
                    fontSize: 20,
                  }
                }
              }
            ],
              props: {
                style:{
                  backgroundColor: 'red'
                }
              }
            }
          )
        ),
        style:{
          flex: 1,
          backgroundColor: 'pink'
        }
      }
    }
moh3n9595 commented 2 years ago

dear @GlenIntoBeyond, react-native-dynamic-render doesn't implement a JSON parser for function props. But it can be a good feature. Can you work on that?