mardi 8 janvier 2019

test database for react-native app development

I'm in the early stages of developing an app with react-native, and I need a DB implementation for for testing and development. I thought that the obvious choice would be to use simple JSON files included with the source, but the only way I see to load JSON files requires that you know the file name ahead of time. This means that the following does not work:

getTable = (tableName) => require('./table-' + tableName + '.json') // ERROR!

I cannot find a simple way to load files at runtime.

What is the proper way to add test data to a react-native app?

Aucun commentaire:

Enregistrer un commentaire