title: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321
body: <p>I am trying to create few react components with few custom changes as package and publish into npm so that other projects can use them by importing package.</p>
  
  <p>My package is "sample-testing" available at (<a href="https://www.npmjs.com/package/sample-testing" rel="noreferrer">https://www.npmjs.com/package/sample-testing</a>).</p>
  
  <p>Using "webpack" and "babel loader" to traslate the jsx files.</p>
  
  <p>Getting below error when I tried to use that component from this package.</p>
  
  <p><strong>Minified React error #321; visit <a href="https://reactjs.org/docs/error-decoder.html?invariant=321" rel="noreferrer">https://reactjs.org/docs/error-decoder.html?invariant=321</a> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.</strong> </p>
  
  <p>This error is coming only when I used material ui components inside package but not with regular html components.</p>
  
  <p><strong>.babelrc</strong></p>
  
  <pre><code>  {
   "presets": ["react", "env", "stage-0"]
    }
  </code></pre>
  
  <p><strong>wepack.config.js</strong></p>
  
  <pre><code>var path = require("path");
  
  module.exports = {
    mode: "production",
    entry: {
      TButton: "./src/TButton.jsx"
    },
    output: {
      path: path.resolve("lib"),
      filename: "[name].js",
      libraryTarget: "commonjs2"
    },
    module: {
      rules: [
        {
          test: /\.jsx?$/,
          exclude: /(node_modules)/,
          use: "babel-loader"
        }
      ]
    }
  };
  </code></pre>
  
  <p><strong>TButton.jsx</strong></p>
  
  <pre><code>import React from "react";
  
  import TextField from "@material-ui/core/TextField";
  
  class TButton extends React.Component {
    constructor(props) {
      super(props);
    }
  
    render() {
      return &lt;TextField id="standard-basic" label="Standard" /&gt;;
    }
  }
  
  export default TButton;
  </code></pre>
  
  <p>Here is the codesandbox link (<a href="https://codesandbox.io/s/xenodochial-mcclintock-xtkh6?file=/src/index.js" rel="noreferrer">https://codesandbox.io/s/xenodochial-mcclintock-xtkh6?file=/src/index.js</a>) to replicate the error which I am getting in my project when I used in my project.
  Please help me to resolve it.</p>