Code block rendering inline-block in .tsx
See original GitHub issueI’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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
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!