How to use the rax-proptypes.number function in rax-proptypes

To help you get started, we’ve selected a few rax-proptypes 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 alibaba / rax / packages / rax / src / vdom / __tests__ / context.js View on Github external
it('should filter out context not in contextTypes', function() {
    class MyComponent extends Component {
      static contextTypes = {
        foo: PropTypes.string,
      };

      render() {
        return <div>;
      }
    }

    class ComponentInFooBarContext extends Component {
      static childContextTypes = {
        foo: PropTypes.string,
        bar: PropTypes.number,
      };

      getChildContext() {
        return {
          foo: 'abc',
          bar: 123,
        };
      }

      render() {
        return ;
      }
    }

    let instance = render();
    expect(instance._internal._renderedComponent._instance.context).toEqual({foo: 'abc'});</div>

rax-proptypes

Rax Proptypes

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages