Some things have changed with enzyme 3 that deviate from version 2, and in some cases deviate from what even the enzyme docs suggest. Here's some of the gotchas I came across in upgrading from enzyme 2 to 3.
React
render () {
return (
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
class MessageModalBody extends Component { | |
render () { | |
return ( | |
<TabList> | |
<TabPanel title="Score Range"> | |
<MessageForm showScoreFilter={true} /> | |
</TabPanel> |
The purpose of this document is to help define the components that comprise Instructure UI's dialog components. Dialog components typically render outside the context of the application and are the primary focal point when rendered.
This represents a refactor as specified by Jen Stern.
These are the low-level components needed for dialogs.
The purpose of this document is to help define the components that comprise Instructure UI's dialog components. Dialog components typically render outside the context of the application and are the primary focal point when rendered.
This represents the current state of things.
These are the low-level components needed for dialogs.
Proposal for how to refactor InstUI's use of <Portal />
.
There are several issues with how <Portal />
is currently being used.
<Portal />
in our code base. A version that we wrote ourselves and a version packaged with react-overlays
. This causes unecessary overhead.// Which is the best practice for React? | |
// This needs to be compatible with RequireJS. | |
module.exports = { | |
externals: { | |
'react': 'React', | |
'react-dom': 'ReactDOM' | |
}, | |
// - OR - |
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
'use strict'; | |
/* | |
Pre Babel | |
import axios from 'axios' |
Example use of <FormField/>
:
<FormField label="Username" errors={['Cannot be left blank']}>
<input type="text" name="username" value=""/>
</FormField>
This renders something like:
build/ | |
node_modules/ |