How to use the react-hot-loader.cold function in react-hot-loader

To help you get started, we’ve selected a few react-hot-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaearon / react-hot-loader / examples / hotCold / src / Counter.js View on Github external
state = { count: 0 };

  componentDidMount() {
    this.interval = setInterval(() => this.setState(prevState => ({ count: prevState.count + 1 })), 200);
  }

  componentWillUnmount() {
    clearInterval(this.interval);
  }

  render() {
    return <div>#{this.state.count}</div>;
  }
}

export default cold(Counter);
//export default Counter;
github gaearon / react-hot-loader / examples / hotCold / src / reactHotLoader.setup.js View on Github external
  onComponentCreate: (type, name) => name.indexOf('styled') > 0 && cold(type),
});
github LWJGL / lwjgl3-www / client / RHL.ts View on Github external
  onComponentRegister: (type, name, file) => file.indexOf('node_modules') > 0 && cold(type),
  logLevel: 'no-errors-please',
github neo-one-suite / neo-one / packages / neo-one-editor / src / FullEditor.tsx View on Github external
dispatch(updateTestSuite(suite));
      },
      onRemoveSuite: async (path: string) =&gt; {
        dispatch(removeTestSuite(path));
      },
      onUpdateTest: async (path: string, test: Test) =&gt; {
        dispatch(updateTest({ path, test }));
      },
      setTestsRunning: async (running: boolean) =&gt; {
        dispatch(setTestsRunning(running));
      },
    },
  }),
)(FullEditorBase);

export const FullEditor = cold((props: ExternalProps) =&gt; (
  
    
  
));
github react-toolbox / react-toolbox / spec / components / tooltip.js View on Github external
import React from 'react';
import Button from '../../components/button';
import Input from '../../components/input';
import FontIcon from '../../components/font_icon';
import Tooltip, { tooltipFactory } from '../../components/tooltip';
import Chip from '../../components/chip';
import Avatar from '../../components/avatar';
import { cold } from 'react-hot-loader';

const ColdAvatar = cold(Avatar)

const TooltipFontIcon = tooltipFactory({ passthrough: false })(FontIcon);
const TooltipButton = Tooltip(Button);
const TooltipInput = Tooltip(Input);
const TooltipStrong = Tooltip(({ children, ...other }) =&gt; {
  delete other.theme;
  return <strong>{children}</strong>;
});
const TooltipStrongDirect = Tooltip('strong');
const ChipTooltip = Tooltip(Chip);

const TooltipTest = () =&gt; (
  <section>
    <h5>Tooltip</h5>
    <p>Give information on :hover</p>
    </section>
github murillo94 / weather-pwa / src / components / ViewCity / index.js View on Github external
onComponentRegister: type =>
    (String(type).indexOf('useState') > 0 ||
      String(type).indexOf('useEffect') > 0) &&
    cold(type)
});
github react-toolbox / react-toolbox / spec / components / avatar.js View on Github external
import React from 'react';
import Avatar from '../../components/avatar';
import GithubIcon from './github_icon';
import { cold } from 'react-hot-loader';

const ColdAvatar = cold(Avatar)

const AvatarTest = () =&gt; (
  <section>
    <h5>Avatars</h5>
    <p>Provide an image source or object, a font icon, children or a title to use its first letter.</p>
    
    } /&gt;
    <img alt="foobar" src="https://placeimg.com/80/80/animals">
    
    
    
    
  </section>