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.

ToastContents: "Warning: Unknown props `store`, `intl`, `router`, `history` on <div> tag."

See original GitHub issue

Maybe I’m not using the Toast component correctly, but this warning always comes up when the Toast is render. Basically, I have a boolean in my state that tells to render or not the toast inside de App component.

let toast = null;
if(displayToast){
    toast = (<Toast status={status} onClose={onClose}>{message} </Toast>)
}

<BrowserRouter>
    <App centered={false} inline >
         {toast}
         <Switch>
             <Route exact path="/">
                 <Redirect to={PATHS.home} />
             </Route>
             <Route path={PATHS.home} component={HomePage}/>
          </Switch>
           .....
     </App>
</BrowserRouter>

Expected Behavior

The Toast renders without warning.

Actual Behavior

The parent component throws a warning.

URL, screen shot, or Codepen exhibiting the issue

Link in the warning: https://facebook.github.io/react/warnings/unknown-prop.html

screen shot 2017-08-02 at 8 47 38 am

Your Environment

  • Grommet version: 1.6.0
  • Browser Name and version: Chrome

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jstlaurentcommented, Aug 17, 2017

@alansouzati : If I’m reading the code right, the Toast component is explicitly extracting these four elements (history, intl, router and store) from the context and passing them as props to the ToastContents sub-component, which in turn now passes them on the div component (which can’t handle them).

Per the comments, that’s a way to carry along the rendering context into the layer. But these four elements should be removed from props and transformed back into a rendering context in ToastContents before the rest of the props can be passed down to the div.

That they are not is the origin of the problem. I’m not sure HOC wrappers are the issue here, since we’re not using any.

0reactions
jstlaurentcommented, Aug 18, 2017

@alansouzati : Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Team:Estonia TUIT/f50ec03 - iGEM 2020
L:function(){return new c.a.Store(Object.assign({strict:!1},L))};var N={} ... :[Do],props:{aspect:{type:[Number,String],default:"1:1"},tag:{type:String ...
Read more >
frequent-classes - CodaLab Worksheets
... 4916 load 4914 div 4905 e 4866 t 4860 alert 4849 i 4844 static 4842 third ... 2709 remove 2707 store 2698...
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