question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

display inline not working for Text/View

See original GitHub issue

Styling Text or View components as display: "inline" does not appear to be working. I would expect the elements to render next to each other instead of stacking.

Example REPL

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
keithmichelsoncommented, Dec 11, 2019

Seeing the same problem. Had to use flexbox.

const styles = StyleSheet.create({
  inline: {
    display: "flex",
    flexDirection: "row"
  }
});

const Inline = () => (
  <Document>
  	<Page>
      <View style={styles.inline}>
      	<Text style={styles.inline}>bar</Text>
        <Text style={styles.inline}>baz</Text>
      </View>
    </Page>
  </Document>
)

ReactPDF.render(<Inline />);
2reactions
yoshigcommented, Jun 16, 2021

The issue with this is having text that we’d want to wrap onto the next line.

const styles = StyleSheet.create({
  inline: {
    display: "flex",
    flexDirection: "row"
  }
});

const Inline = () => (
  <Document>
  	<Page>
      <View style={styles.inline}>
      	<Text style={styles.inline}>If this text is all written out</Text>
        <Text style={styles.inline}>and then this needs to continue and this text is also in the same row and wraps to the next line</Text>
      </View>
    </Page>
  </Document>
)

ReactPDF.render(<Inline />);
Read more comments on GitHub >

github_iconTop Results From Across the Web

html - Display:inline not working - Stack Overflow
The reason it's not working is because you are using it insidea a div and that div element has only li element ,...
Read more >
Is it possible to display inline images from html in an Android ...
Note: The information provided in this video is as it is with no ... If there any issues, contact us on - htfyc...
Read more >
InlineContentView - Android Developers
This view can be overlaid by other windows, i.e. redressed, but if this is the case the inlined UI would not be interactive....
Read more >
Style - React Native
The style names and values usually match how CSS works on the web, ... import React from 'react'; import { StyleSheet, Text, View...
Read more >
Pretty Printing - Altova XMLSpy 2022 Enterprise Edition
•Text View Settings (click the button to access the settings dialog) ... attributes are displayed inline (on the same line as its parent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found