Example with multiple components
See original GitHub issueI tried a few things to get it working, but I’m not there yet (see #26).
Example
I have a Page
(component) and another component representing a User
. The Page
will show a colleciton of User
components.
If I add the following to Page.js
import { SimpleImg, SimpleImgProvider } from 'react-simple-img'
class Page {
// ...
render () {
return this.props.users.map((user) => <User {...user} SimpleImg={SimpleImg} />)
}
}
export default SimpleImgProvider(Page, { threshold: 0.5 })
And in User.js
I use props.SimpleImg, the images are never updated, only the placeholder is shown.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Multiple Components | React
In React, an owner is the component that sets the props of other components. More formally, if a component X is created in...
Read more >multiple component collocation | meanings and examples of use
Examples of multiple component in a sentence, how to use it. 15 examples: This becomes essential when multiple component programs are being tested, ......
Read more >Multiple Components - ts - TUTORIAL - Angular
Multiple Components. Refactor the master/detail view into separate components. The AppComponent is doing everything at the moment.
Read more >Usage Across Multiple Components - Thinkster.io
This component is going to comprise of the Banner and MainView components. Let's start with Banner. This component is what is known as...
Read more >Advanced examples with multiple components? #18 - GitHub
Advanced examples with multiple components? #18. Closed. soullivaneuh opened this issue on Nov ...
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 FreeTop 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
Top GitHub Comments
Nice work thank you
On Sun, 5 Aug 2018 at 11:29 am, Bill notifications@github.com wrote:
I will take a look the
provider
issue soon over the weekend. To be honest i probably need to update the context API too.