Guest User

Untitled

a guest
May 22nd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. const panes = [
  2. {
  3. menuItem: 'Record 1',
  4. render: () => <Tab.Pane>Tab 1 Content</Tab.Pane>
  5. }
  6. ]
  7. ...
  8. <Tab panes={panes}/>
  9.  
  10. getPanes() {
  11. return this
  12. .state
  13. .source
  14. .map((source) => [{
  15. menuItem: source.sourceName,
  16. render: () => <Tab.Pane>Tab 1 Content</Tab.Pane>
  17. }])
  18. }
  19. ...
  20. <Tab panes={this.getPanes}/>
  21.  
  22. Warning: Failed prop type: Invalid prop `panes` of type `function` supplied to `Tab`, expected an array.
  23.  
  24. getPanes() {
  25. return this
  26. .state
  27. .source
  28. .map((source) => ({
  29. menuItem: source.sourceName,
  30. render: () => <Tab.Pane>Tab 1 Content</Tab.Pane>
  31. }));
  32. }
Add Comment
Please, Sign In to add comment