Skip to content

Rendering Non-React Component (HTML/JSON page) #14991

Discussion options

You must be logged in to vote

Thank you @srikanth912 for your help!

Fortunately, I found this little tweak to work excellently:
Steps:

  • Add a .js at the end of the pages/config.json file.
  • Still use a React component but send it as either a string or an array.

This is a working example

// pages/config.json.js

const sampleConfigData = [{"id":1,"first_name":"Petronia","last_name":"DelaField","email":"pdelafield0@state.gov","gender":"Female","ip_address":"200.86.172.105"},
{"id":2,"first_name":"Kendall","last_name":"Shilladay","email":"kshilladay1@who.int","gender":"Male","ip_address":"53.26.234.195"},
{"id":3,"first_name":"Shelia","last_name":"Jenoure","email":"sjenoure2@acquirethisname.com","gender":"Female","ip_address"

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
5 replies
@senavinicius
Comment options

@kingerking
Comment options

@senavinicius
Comment options

@msafi
Comment options

@Noitidart
Comment options

Comment options

You must be logged in to vote
2 replies
@srikanth912
Comment options

@Harrisonkamau
Comment options

Answer selected by Harrisonkamau
Comment options

You must be logged in to vote
3 replies
@Harrisonkamau
Comment options

@Harrisonkamau
Comment options

@illuminist
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants