replace specific text with view in reactNativeVertical (rotated) text in HTML tableReactNative: how to center text?ReactNative: place a view on top of the border of a Circle-ViewForward slash causing errors in Javascript/JSXCannot push open tags inside mapJavascript .css not working nor jquery .blueReactNative: Text pushing content off-screenHow to center text within a text area?Can't align text horizontally in ReactNative UI
Three Singles in Three Clubs
Is there such a thing as too inconvenient?
Most practical knots for hitching a line to an object while keeping the bitter end as tight as possible, without sag?
Why is 日本 read as "nihon" but not "nitsuhon"?
Verb form to finish someone else's sentence?
In the MCU, why does Mjölnir retain its enchantments after Ragnarok?
How to dismiss intrusive questions from a colleague with whom I don't work?
LeetCode: Pascal's Triangle C#
Defense against attacks using dictionaries
Do ability scores have any effect on casting Wish spell
Why we don't have vaccination against all diseases which are caused by microbes?
What is the hex versus octal timeline?
How would one country purchase another?
What is this symbol: semicircles facing eachother
What magic extends life or grants immortality
If I have a 16.67% fail rate (N=24) & I do another 24 tests, what is the likelihood that I get 0 fails by chance?
Why didn’t Doctor Strange stay in the original winning timeline?
System to validate run time complexity requirements
Does an object count as "being moved" when placed in a Bag of Holding before its wielder moves, and then after moving they take the object out again?
Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?
Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?
Why doesn't the Falcon-9 first stage use three legs to land?
Script that helps people make better choices
Is there a limit on how long the casting (speaking aloud part of the spell) of Wish can be?
replace specific text with view in reactNative
Vertical (rotated) text in HTML tableReactNative: how to center text?ReactNative: place a view on top of the border of a Circle-ViewForward slash causing errors in Javascript/JSXCannot push open tags inside mapJavascript .css not working nor jquery .blueReactNative: Text pushing content off-screenHow to center text within a text area?Can't align text horizontally in ReactNative UI
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
iam having a text string with characters like "__"(two underscores) in the string whenever i encounter the two underscores i want to replace them with a specific view like box and render it so for example:
str = "iam __ and i want to go to __"
so i want to render iam (want to render rectangular box here) and i want to go to (rectangular box here)
i have tried using the split function in js and split them by __ and tried pushing the jsx to array based on condition but it was rendering in different lines is there any better way to do it
code i tried:
const stringsArr = str.split('__');
const toRender = []
for(let i=0;i<stringsArr.length;i++)
toRender.push(<Text styles=styles.emptyBlock />)
toRender.push(<Text>stringsArr[i]</Text>)
react-native styling text-styling
add a comment |
iam having a text string with characters like "__"(two underscores) in the string whenever i encounter the two underscores i want to replace them with a specific view like box and render it so for example:
str = "iam __ and i want to go to __"
so i want to render iam (want to render rectangular box here) and i want to go to (rectangular box here)
i have tried using the split function in js and split them by __ and tried pushing the jsx to array based on condition but it was rendering in different lines is there any better way to do it
code i tried:
const stringsArr = str.split('__');
const toRender = []
for(let i=0;i<stringsArr.length;i++)
toRender.push(<Text styles=styles.emptyBlock />)
toRender.push(<Text>stringsArr[i]</Text>)
react-native styling text-styling
add a comment |
iam having a text string with characters like "__"(two underscores) in the string whenever i encounter the two underscores i want to replace them with a specific view like box and render it so for example:
str = "iam __ and i want to go to __"
so i want to render iam (want to render rectangular box here) and i want to go to (rectangular box here)
i have tried using the split function in js and split them by __ and tried pushing the jsx to array based on condition but it was rendering in different lines is there any better way to do it
code i tried:
const stringsArr = str.split('__');
const toRender = []
for(let i=0;i<stringsArr.length;i++)
toRender.push(<Text styles=styles.emptyBlock />)
toRender.push(<Text>stringsArr[i]</Text>)
react-native styling text-styling
iam having a text string with characters like "__"(two underscores) in the string whenever i encounter the two underscores i want to replace them with a specific view like box and render it so for example:
str = "iam __ and i want to go to __"
so i want to render iam (want to render rectangular box here) and i want to go to (rectangular box here)
i have tried using the split function in js and split them by __ and tried pushing the jsx to array based on condition but it was rendering in different lines is there any better way to do it
code i tried:
const stringsArr = str.split('__');
const toRender = []
for(let i=0;i<stringsArr.length;i++)
toRender.push(<Text styles=styles.emptyBlock />)
toRender.push(<Text>stringsArr[i]</Text>)
react-native styling text-styling
react-native styling text-styling
asked Mar 27 at 16:06
aravind_reddyaravind_reddy
1,8712 gold badges8 silver badges19 bronze badges
1,8712 gold badges8 silver badges19 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Components will render below each other by default. Wrap a View
around each text line and give it a style of flexDirection: 'row'
so that they render side by side. If you want it working like a paragraph, then apply flexWrap: 'wrap'
as well.
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via'n'
first, and having aView
wrapper for each element of that array.
– zaytrix
Mar 27 at 18:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55381742%2freplace-specific-text-with-view-in-reactnative%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Components will render below each other by default. Wrap a View
around each text line and give it a style of flexDirection: 'row'
so that they render side by side. If you want it working like a paragraph, then apply flexWrap: 'wrap'
as well.
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via'n'
first, and having aView
wrapper for each element of that array.
– zaytrix
Mar 27 at 18:03
add a comment |
Components will render below each other by default. Wrap a View
around each text line and give it a style of flexDirection: 'row'
so that they render side by side. If you want it working like a paragraph, then apply flexWrap: 'wrap'
as well.
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via'n'
first, and having aView
wrapper for each element of that array.
– zaytrix
Mar 27 at 18:03
add a comment |
Components will render below each other by default. Wrap a View
around each text line and give it a style of flexDirection: 'row'
so that they render side by side. If you want it working like a paragraph, then apply flexWrap: 'wrap'
as well.
Components will render below each other by default. Wrap a View
around each text line and give it a style of flexDirection: 'row'
so that they render side by side. If you want it working like a paragraph, then apply flexWrap: 'wrap'
as well.
answered Mar 27 at 16:30
zaytrixzaytrix
9841 silver badge10 bronze badges
9841 silver badge10 bronze badges
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via'n'
first, and having aView
wrapper for each element of that array.
– zaytrix
Mar 27 at 18:03
add a comment |
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via'n'
first, and having aView
wrapper for each element of that array.
– zaytrix
Mar 27 at 18:03
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
i tired that already but there are n inside the text which is make the text after that go down and blank is coming upside
– aravind_reddy
Mar 27 at 17:38
In that case, I would recommend splitting the string via
'n'
first, and having a View
wrapper for each element of that array.– zaytrix
Mar 27 at 18:03
In that case, I would recommend splitting the string via
'n'
first, and having a View
wrapper for each element of that array.– zaytrix
Mar 27 at 18:03
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55381742%2freplace-specific-text-with-view-in-reactnative%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown