Skip to content

Instantly share code, notes, and snippets.

@pnispel
Created September 21, 2017 20:30
Show Gist options
  • Save pnispel/2a0ac8fa179bbcea928beee4a59d5a97 to your computer and use it in GitHub Desktop.
Save pnispel/2a0ac8fa179bbcea928beee4a59d5a97 to your computer and use it in GitHub Desktop.
Dropdowns after init
import JQueryTypeDropdown from './JQueryTypeDropdown.jsx'
import FoundationTypeDropdown from './FoundationTypeDropdown.jsx'
const App = () => {
return (
<div>
<JQueryTypeDropdown />
<FoundationTypeDropdown />
</div>
);
}
export default App
export default class FoundationTypeDropdown extends React.component {
componentDidMount() {
$(document).foundation('dropdown', 'reflow')
// or maybe $(document).foundation()
}
render() {
return (
<div class="some-foundation-dropdown-class" />
)
}
}
export default class JQueryTypeDropdown extends React.component {
componentDidMount() {
$.someDropdownPlugin(this.dropdownEl)
}
render() {
return (
<div ref={(el) => this.dropdownEl = el} />
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment