<?xml version="1.0" encoding="utf-8" ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:tt="http://teletype.in/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"><title>Open collections</title><author><name>Open collections</name></author><id>https://teletype.in/atom/open_collections</id><link rel="self" type="application/atom+xml" href="https://teletype.in/atom/open_collections?offset=0"></link><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><link rel="next" type="application/rss+xml" href="https://teletype.in/atom/open_collections?offset=10"></link><link rel="search" type="application/opensearchdescription+xml" title="Teletype" href="https://teletype.in/opensearch.xml"></link><updated>2026-04-15T23:21:21.304Z</updated><entry><id>open_collections:HXqprLoRA</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/HXqprLoRA?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What is ReactDOMServer?</title><published>2020-06-23T21:45:59.419Z</published><updated>2020-06-23T21:45:59.419Z</updated><summary type="html">&lt;img src=&quot;https://telegra.ph/file/b09f3e62e40a4900872ad.png&quot;&gt;The ReactDOMServer object enables you to render components to static markup (typically used on node server). This object is mainly used for server-side rendering (SSR). The following methods can be used in both the server and browser environments:</summary><content type="html">
  &lt;p&gt;The &lt;code&gt;ReactDOMServer&lt;/code&gt; object enables you to render components to static markup (typically used on node server). This object is mainly used for &lt;em&gt;server-side rendering&lt;/em&gt; (SSR). The following methods can be used in both the server and browser environments:&lt;/p&gt;
  &lt;ol&gt;
    &lt;li&gt;&lt;code&gt;renderToString()&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;renderToStaticMarkup()&lt;/code&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;p&gt;For example, you generally run a Node-based web server like Express, Hapi, or Koa, and you call &lt;code&gt;renderToString&lt;/code&gt; to render your root component to a string, which you then send as response.&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/b09f3e62e40a4900872ad.png&quot; width=&quot;714&quot; /&gt;
  &lt;/figure&gt;

</content></entry><entry><id>open_collections:w3qHWTdN4</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/w3qHWTdN4?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What is the purpose of render method of react-dom?</title><published>2020-06-23T21:44:26.784Z</published><updated>2020-06-23T21:44:26.784Z</updated><summary type="html">&lt;img src=&quot;https://telegra.ph/file/deaa43e8e161460d07fca.png&quot;&gt;This method is used to render a React element into the DOM in the supplied container and return a reference to the component. If the React element was previously rendered into container, it will perform an update on it and only mutate the DOM as necessary to reflect the latest changes.</summary><content type="html">
  &lt;p&gt;This method is used to render a React element into the DOM in the supplied container and return a reference to the component. If the React element was previously rendered into container, it will perform an update on it and only mutate the DOM as necessary to reflect the latest changes.&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/deaa43e8e161460d07fca.png&quot; width=&quot;689&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;If the optional callback is provided, it will be executed after the component is rendered or updated.&lt;/p&gt;

</content></entry><entry><id>open_collections:sNEX5qTxf</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/sNEX5qTxf?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What is the use of react-dom package?</title><published>2020-06-23T21:42:09.813Z</published><updated>2020-06-23T21:42:09.813Z</updated><summary type="html">The react-dom package provides DOM-specific methods that can be used at the top level of your app. Most of the components are not required to use this module. Some of the methods of this package are:</summary><content type="html">
  &lt;p&gt;The &lt;code&gt;react-dom&lt;/code&gt; package provides &lt;em&gt;DOM-specific methods&lt;/em&gt; that can be used at the top level of your app. Most of the components are not required to use this module. Some of the methods of this package are:&lt;/p&gt;
  &lt;ol&gt;
    &lt;li&gt;&lt;code&gt;render()&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;hydrate()&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;unmountComponentAtNode()&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;findDOMNode()&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;createPortal()&lt;/code&gt;&lt;/li&gt;
  &lt;/ol&gt;

</content></entry><entry><id>open_collections:1LEMR0gV6</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/1LEMR0gV6?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What are the recommended ways for static type checking?</title><published>2020-06-23T21:41:04.783Z</published><updated>2020-06-23T21:41:04.783Z</updated><summary type="html">Normally we use PropTypes library (React.PropTypes moved to a prop-types package since React v15.5) for type checking in the React applications. For large code bases, it is recommended to use static type checkers such as Flow or TypeScript, that perform type checking at compile time and provide auto-completion features.</summary><content type="html">
  &lt;p&gt;Normally we use &lt;em&gt;PropTypes library&lt;/em&gt; (&lt;code&gt;React.PropTypes&lt;/code&gt; moved to a &lt;code&gt;prop-types&lt;/code&gt; package since React v15.5) for &lt;em&gt;type checking&lt;/em&gt; in the React applications. For large code bases, it is recommended to use &lt;em&gt;static type checkers&lt;/em&gt; such as Flow or TypeScript, that perform type checking at compile time and provide auto-completion features.&lt;/p&gt;

</content></entry><entry><id>open_collections:5iiGV1GuL</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/5iiGV1GuL?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>How error boundaries handled in React v15?</title><published>2020-06-23T21:39:29.522Z</published><updated>2020-06-23T21:39:29.522Z</updated><summary type="html">React v15 provided very basic support for error boundaries using unstable_handleError method. It has been renamed to componentDidCatch in React v16.</summary><content type="html">
  &lt;p&gt;React v15 provided very basic support for &lt;em&gt;error boundaries&lt;/em&gt; using &lt;code&gt;unstable_handleError&lt;/code&gt; method. It has been renamed to &lt;code&gt;componentDidCatch&lt;/code&gt; in React v16.&lt;/p&gt;

</content></entry><entry><id>open_collections:MEHrtv_XB</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/MEHrtv_XB?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What are error boundaries in React v16?</title><published>2020-06-23T21:38:02.830Z</published><updated>2020-06-23T21:38:02.830Z</updated><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://teletype.in/files/87/9f/879f4713-2ec4-42cf-97a2-692b685c8098.png"></media:thumbnail><summary type="html">&lt;img src=&quot;https://telegra.ph/file/a91a7504b1e810a457e98.png&quot;&gt;Error boundaries are components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.</summary><content type="html">
  &lt;p&gt;&lt;em&gt;Error boundaries&lt;/em&gt; are components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.&lt;/p&gt;
  &lt;p&gt;A class component becomes an error boundary if it defines a new lifecycle method called &lt;code&gt;componentDidCatch(error, info)&lt;/code&gt; or &lt;code&gt;static getDerivedStateFromError() &lt;/code&gt;:&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/a91a7504b1e810a457e98.png&quot; width=&quot;713&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;After that use it as a regular component:&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/cd20048e54231d5d82c3d.png&quot; width=&quot;728&quot; /&gt;
  &lt;/figure&gt;

</content></entry><entry><id>open_collections:nrs1EIYPJ</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/nrs1EIYPJ?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What are the advantages of React?</title><published>2020-06-23T21:22:07.280Z</published><updated>2020-06-23T21:22:07.280Z</updated><summary type="html">Increases the application's performance with Virtual DOM.</summary><content type="html">
  &lt;p&gt;Increases the application&amp;#x27;s performance with &lt;em&gt;Virtual DOM&lt;/em&gt;.&lt;/p&gt;
  &lt;p&gt;JSX makes code easy to read and write.&lt;/p&gt;
  &lt;p&gt;It renders both on client and server side (&lt;em&gt;SSR&lt;/em&gt;).&lt;/p&gt;
  &lt;p&gt;Easy to integrate with frameworks (Angular, Backbone) since it is only a view library.&lt;/p&gt;
  &lt;p&gt;Easy to write unit and integration tests with tools such as Jest.&lt;/p&gt;

</content></entry><entry><id>open_collections:0o8z9nw6n</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/0o8z9nw6n?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What are the limitations of React?</title><published>2020-06-23T21:17:29.731Z</published><updated>2020-06-23T21:17:29.731Z</updated><summary type="html">React is just a view library, not a full framework.</summary><content type="html">
  &lt;p&gt;React is just a view library, not a full framework.&lt;/p&gt;
  &lt;p&gt;There is a learning curve for beginners who are new to web development.&lt;/p&gt;
  &lt;p&gt;Integrating React into a traditional MVC framework requires some additional configuration.&lt;/p&gt;
  &lt;p&gt;The code complexity increases with inline templating and JSX.&lt;/p&gt;
  &lt;p&gt;Too many smaller components leading to over engineering or boilerplate.&lt;/p&gt;

</content></entry><entry><id>open_collections:PDjrLp0O0</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/PDjrLp0O0?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>How to apply validation on props in React?</title><published>2020-06-23T21:10:42.237Z</published><updated>2020-06-23T21:10:42.237Z</updated><summary type="html">&lt;img src=&quot;https://telegra.ph/file/abb4844d85deea26666dd.png&quot;&gt;When the application is running in development mode, React will automatically check all props that we set on components to make sure they have correct type. If the type is incorrect, React will generate warning messages in the console. It's disabled in production mode due to performance impact. The mandatory props are defined with isRequired.</summary><content type="html">
  &lt;p&gt;When the application is running in &lt;em&gt;development mode&lt;/em&gt;, React will automatically check all props that we set on components to make sure they have &lt;em&gt;correct type&lt;/em&gt;. If the type is incorrect, React will generate warning messages in the console. It&amp;#x27;s disabled in &lt;em&gt;production mode&lt;/em&gt; due to performance impact. The mandatory props are defined with &lt;code&gt;isRequired&lt;/code&gt;.&lt;/p&gt;
  &lt;p&gt;The set of predefined prop types:&lt;/p&gt;
  &lt;ol&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.number&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.string&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.array&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.object&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.func&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.node&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.element&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.bool&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.symbol&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;PropTypes.any&lt;/code&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;p&gt;We can define &lt;code&gt;propTypes&lt;/code&gt; for &lt;code&gt;User&lt;/code&gt; component as below:&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/abb4844d85deea26666dd.png&quot; width=&quot;731&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;Note: In React v15.5 &lt;em&gt;PropTypes&lt;/em&gt; were moved from &lt;code&gt;React.PropTypes&lt;/code&gt; to &lt;code&gt;prop-types&lt;/code&gt; library.&lt;/p&gt;

</content></entry><entry><id>open_collections:EMhIA49jG</id><link rel="alternate" type="text/html" href="https://teletype.in/@open_collections/EMhIA49jG?utm_source=teletype&amp;utm_medium=feed_atom&amp;utm_campaign=open_collections"></link><title>What are stateful components?</title><published>2020-06-23T21:09:11.283Z</published><updated>2020-06-23T21:09:11.283Z</updated><summary type="html">&lt;img src=&quot;https://telegra.ph/file/b47ee67da182a7584759f.png&quot;&gt;If the behaviour of a component is dependent on the state of the component then it can be termed as stateful component. These stateful components are always class components and have a state that gets initialized in the constructor.</summary><content type="html">
  &lt;p&gt;If the behaviour of a component is dependent on the &lt;em&gt;state&lt;/em&gt; of the component then it can be termed as stateful component. These &lt;em&gt;stateful components&lt;/em&gt; are always &lt;em&gt;class components&lt;/em&gt; and have a state that gets initialized in the &lt;code&gt;constructor&lt;/code&gt;.&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/b47ee67da182a7584759f.png&quot; width=&quot;731&quot; /&gt;
  &lt;/figure&gt;
  &lt;p&gt;React 16.8 Update: Hooks let you use state and other React features without writing classes.&lt;/p&gt;
  &lt;p&gt;&lt;em&gt;The Equivalent Functional Component&lt;/em&gt;&lt;/p&gt;
  &lt;figure class=&quot;m_original&quot;&gt;
    &lt;img src=&quot;https://telegra.ph/file/0b9939a68e9fefb2975d9.png&quot; width=&quot;732&quot; /&gt;
  &lt;/figure&gt;

</content></entry></feed>