Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some code to work when propTypes are stripped in prod mode
our babel configuration removes all of the PropType declarations From our code in when build for production mode. (See 'transform-react-remove-prop-types' in babel.config.js) That is because react does not actually do any prop-type verifying In prod mode so that code would be just wasted bytes sent to the browser This means that our code should not actually depend on propTypes at runtime The way this was written, it was depending on CanvasAsyncSelect.propTypes existing even in prod mode Test plan: * if you run the code that uses this in prod mode you shouldn’t get react-dom.production.min.js:193 TypeError: Cannot read property 'renderLabel' of undefined Change-Id: I598bbc25887b5fdd85a6ed77debf14020ea42376 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218037 Tested-by: Service Cloud Jenkins <[email protected]> Tested-by: Jenkins Reviewed-by: Anju Reddy <[email protected]> QA-Review: Anju Reddy <[email protected]> Product-Review: Ryan Shaw <[email protected]>
- Loading branch information