Skip to content

Instantly share code, notes, and snippets.

@denisraslov
Created October 4, 2017 20:04
Show Gist options
  • Save denisraslov/5d24a6faa19ee4091d9df4c8adb0e3f1 to your computer and use it in GitHub Desktop.
Save denisraslov/5d24a6faa19ee4091d9df4c8adb0e3f1 to your computer and use it in GitHub Desktop.
import React from 'react';
import AdminContent from 'react/components/adminContent';
import UserContent from 'react/components/userContent';
class Page extends React.PureComponent {
render() {
// a Backbone way - still using the global APP instance
if (APP.isUserAdmin()) {
return <AdminContent />;
} else {
return <UserContent />;
}
}
}
export default Page;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment