TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Murali krishna Ande
NA
57
51.8k
How to create a React Native component using JSON Schema
Jan 11 2021 6:11 AM
I am trying to create a component using react-native from below JSON format. And this has to be done with-out using any third party components.
{
"properties"
: {
"taxDetails"
: {
"type"
:
"array"
,
"items"
: {
"properties"
: {
"keyValue"
: {
"type"
:
"string"
},
"keyName"
: {
"type"
:
"string"
},
"index"
: {
"type"
:
"number"
}
}
}
},
"upperBody"
: {
"type"
:
"array"
,
"items"
: {
"properties"
: {
"keyValue"
: {
"type"
:
"string"
},
"keyName"
: {
"type"
:
"string"
},
"index"
: {
"type"
:
"number"
}
}
}
},
"bodyItems"
: {
"type"
:
"object"
,
"properties"
: {
"itemDetails"
: {
"type"
:
"array"
,
"items"
: {
"properties"
: {
"ItemValue"
: {
"type"
:
"string"
},
"ItemPrice"
: {
"type"
:
"string"
},
"ItemQty"
: {
"type"
:
"string"
},
"ItemName"
: {
"type"
:
"string"
}
}
}
},
"itemCount"
: {
"type"
:
"string"
}
}
},
"paymentDetails"
: {
"type"
:
"object"
,
"properties"
: {
"paymentMeta"
: {
"type"
:
"array"
,
"items"
: {
"properties"
: {
"keyValue"
: {
"type"
:
"string"
},
"keyName"
: {
"type"
:
"string"
},
"index"
: {
"type"
:
"number"
}
}
}
},
"paymentType"
: {
"type"
:
"string"
}
}
}
}
},
}
By using the above JSON schema, I have to create a template like below.
<View>
<Text>{item.keyName}</Text>
<Text>{item.keyValue}</Text>
<Text>{item.index}</Text>
</View>
<View>
<Text>{item.ItemName}</Text>
<Text>{item.ItemPrice}</Text>
<Text>{item.ItemQty}</Text>
<Text>{item.ItemValue}</Text>
</View>
If I create a template like that, I can show the values by using other JSON. So can someone please help me in creating a template like above.
Reply
Answers (
1
)
React JS App deployed in server. Blank white page displayed
How I can consume a BAPI from JavaScript?