Why does Carousel not accept Next.js Image? - reactjs

We use react-responsive-carousel in our Next.js project. When we replaced img with Image to optimize thumbnail image size, thumbnails disappeared. Do you know why?

Looks like it's a limitation of react-responsive-carousel:
Note that it's not possible to get images rendered inside custom components. Carousel will find the thumbs if they are rendered as direct children of the carousel or if they are inside a div or another normal html element in a way that it's possible to access the children of these elements from the carousel.
For performance reasons, it's not possible to get images inside custom components.
next/image is a wrapper around the <img> element, which means Carousel is not able to pick up the images for the thumbnails.

Related

React Native Export Whole Content of Scroll View into PDF

I am currently working on a react-native project and I am facing the following problem:
I have a ScrollView with dynamic size. I would like to be able to export the content of the ScrollView into a PDF on click of a button. It is like creating a screenshot that scrolls through my whole view before saving the image into a pdf. How can I achieve that ?
I know that there is a component called "react-pdf" that I can use to render my own pdf. Is this the way to go ?
I have also seen that there is a component called "react-native-view-shot" which takes a picture of a view. But in my case it is a ScrollView so I don't think that it will work

Possible to inject material UI styles into iframe?

I'm using material UI 4.9.x and it doesn't seem possible to use MUI in an iframe with the global styles.
I'm trying to use a React portal to inject the content into the iframe.
THAT part works and my MUI context menu works properly, just has the wrong styles.
I'm trying to inject the styles via CssBaseline but that gets injected into the host window not the iframe window.
I've verified this by looking at the DOM and I can see the elements created there under and not in the iframe.
How would I go about injecting this, completely, into the iframe window.
One idea I had was to change the current / global document and window objects to represent the iframe but worried that might be too hacky.

How to add React tooltip on top of JSP?

I have built rich tooltip in React and now I would like to add it to one of the divs in JSP. Since the app is big and I don't have much time to rewrite JSP into React I would like to know how can I grab that div in JSP and add a tooltip on hover.
Unfortunately, I was not able to find a proper answer on SO.

Ant Design Layout Component

I have a very basic implementation of ant design in a react project. I used create-react-app and have went through the suggested steps detailed in the antd documentation.
The problem i have is resizing the Content section of the Layout component. Currently, even though my Dragger component is wrapped within Content component, it is appearing below it. The Content component is represented by the Grey area on the screen. Attempts at resizing it using styling have not yielded desired results.
Here is the code pen. Im simply trying to ensure that the Upload box is located within the Content section, and not below it.
Any help would be awesome!
You've wrapped the Dragger component in a div that is absolutely positioned in the center of the body, so it's disregarding the regular content flow. If you remove that inline CSS it will behave as you'd expect.

How to enable scrolling in CanvasJS charts on mobile?

I am using the ReactJS version of the CanvasJS library.
I have some charts laid out on the screen such that they take up close to 100% height and width on a mobile device.
When I place my fingers on the chart and drag (in order to scroll down the page), I am unable to scroll. This issue doesn't happen on other parts of the page where I don't have the chart.
Is there any way to get scrolling working properly when touching these charts on mobile?
Figured it out.
I had the CanvasJS component wrapped inside a div component.
This div component had the following CSS attributes applied to it:
overflow-y:auto;
overflow:scroll;
overflow-x:auto;
Once I removed those CSS attributes (which didn't need to be there in the first place) I was able to touch-drag on the chart component on mobile.

Resources