Created
January 30, 2016 00:49
-
-
Save viceversus/927a8dd2fe3e178d6726 to your computer and use it in GitHub Desktop.
Entry HoC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import UserList from 'user_list'; | |
import PokemonList from 'pokemon_list'; | |
import listWrapper from 'list_wrapper'; | |
$(function() { | |
function renderList(ListComponent, $domNode) { | |
var List = listWrapper(ListComponent); | |
ReactDOM.render(<List />, $domNode[0]); | |
} | |
function render() { | |
var userList = $('#user-list'), | |
pokemonList = $('#pokemon-list'); | |
if (userList.length > 0) { | |
renderList(UserList, userList); | |
} | |
if (pokemonList.length > 0) { | |
renderList(PokemonList, pokemonList); | |
} | |
} | |
render(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment