如何在离线反应本机应用程序中存储长文本?

发布于 2025-01-16 03:41:33 字数 644 浏览 2 评论 0原文

我正在使用 React Native 构建一个教程应用程序。我设计得很好,但我不知道如何存储它的数据。

我认为像这样存储在对象中......

Tutorial = [
  { 
Intro : {
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incid quis.."
},
     content : {
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do sunt in culpa qui officia deserunt mollit anim id est laborum...
    },
    conclusion : {
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo...
    } 
    }
]

但我认为实现这一目标不是一个好主意。

我很好奇大多数离线编程应用程序是如何开发的。可能你们大多数人都知道像编程中心、mimo...等等这样的应用程序

,所以请告诉我如何在我的 React Native 应用程序中实现这一点

I'm building a tutorial app with react native. I designed it well but I have no idea how can I store it's data.

I think to Store in object like this...

Tutorial = [
  { 
Intro : {
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incid quis.."
},
     content : {
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do sunt in culpa qui officia deserunt mollit anim id est laborum...
    },
    conclusion : {
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmo...
    } 
    }
]

But I don't think it's a good idea to achieve this.

I'm so curious about how most of offline programming app developed. Probably most of you know app like programming hub, mimo... Etc

So please mention me how I can achieve this in my react native app

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑶笙 2025-01-23 03:41:33

对于大多数较小的数据,您可以使用来自react-native的AsyncStorage  ,但是还有更多的数据您可以使用 Realm 和 SQLite 这些库在设备上存储数据。

https://www.npmjs.com/package/react-native-sqlite-存储

https://github.com/realm/realm-js

For most smaller data you can use AsyncStorage from react-native, but there are more data then you can use Realm and SQLite these are libraries to store data on device.

https://www.npmjs.com/package/react-native-sqlite-storage

https://github.com/realm/realm-js

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文