yarn add react-dom@portal:./my-react-dom
Portals vs links
Links have to operate under the assumption that their target folder may not exist until the install is finished; this prevents them from reading the content of the folder, including any
package.json files, and in turn preventing them from listing dependencies.
Portals, on the other hand, must exist at resolution time or an error is thrown. This lets them read the content of the
package.json file and be treated like any other package in the dependency tree - except that its content will be made directly available to the user, rather than copied like
file: would do.