Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

reactjs - what are the better ways to manage text response with lots of linkages

We are developing a feature where we are going to show the description (lots of text). This description will be related to the page and have some dynamic content. Some of those dynamic content will also have links to other pages.

Since the text will be the same for a particular page on all platforms, we decided to create the text at the server and pass it to the client via store, API response etc. But later we realize an issue in this approach.

For the part where we are creating links, we resort to adding <a> tags in the text itself. This is restrictive to the web and we had several questions on our mind

What if the client is a react page and we need to use <Link> tag?
What if the client is an android/ios app, how will we convey the linkages?

Even for react, we have to use the dangerouslySetInnerHTML attribute(because of the anchor tags) to set the description.

Can there be better way to solve this considering various platform and ways to convey linkage correctly?

question from:https://stackoverflow.com/questions/65883640/what-are-the-better-ways-to-manage-text-response-with-lots-of-linkages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...