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.

Code block rendering inline-block in .tsx

See original GitHub issue

I’m using @vercel to ship a pretty simple .tsx app and for some reason, it renders as inline instead of code block. Here’s my code:

const toggleCodeTheme = (window.innerWidth) < 1000 ? hybrid : github; <CopyBlock language="javascript" text={iterative} codeBlock theme={toggleCodeTheme} showLineNumbers={false} />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
daviavmellocommented, Feb 18, 2021

@rajinwonderland thank you for debugging this for me. I tried to force stringify it without success. I did not want to hardcode it into the prop, but for time reasons I went with your solution. I appreciate your project.

1reaction
rajinwonderlandcommented, Feb 18, 2021

Here’s a deployed netlify version for reference and a separate repo for reference as well @daviavmello!

Let me know if this solves your issue!

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding inline styles to react - Stack Overflow
I'm perplex to what I should try but react seems like it doesnt want to play nice with other div elements.
Read more >
Using Inline styles in JSX - CloudBoost
With inline styles, you have to option to combine CSS syntax with JSX code. Syntax. Let's say that we wanted to build a...
Read more >
rajinwonderland/react-code-blocks - GitHub
react -live : A flexible playground for live editing React components by @FormidableLabs. @atlaskit/code : Renders inline code snippets and code blocks. Original ......
Read more >
Inline Styling In React | Pluralsight
And I did it on purpose. Basically, the idea is: React will automatically append a "px" suffix to certain numeric inline style properties....
Read more >
React Display with Bootstrap - examples & tutorial
Use bootstrap class for display: inline to wrap the text inside the element to normally. While using the property display: inline-block will wrap...
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