twobin / twobin/react-lazyload
Load not work when parent element has display: none;
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 485
- PR merge metrics
- No merged PRs in 30d
Description
When I have a `` inside an element with `display: none` and I change this display to block, the content not load. This content only will load after a scroll interaction.
The code is like that:
```js
export default function App() {
const [tab, setTab] = useState(1);
return (
-
setTab(1)}>tab 1
-
setTab(2)}>tab 2
Content of tab 1
Content of tab 2
);
}
```
The problem is that:

And the complete code is here:
https://codesandbox.io/s/determined-hoover-z6cff?file=/src/App.js:104-960
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.