Coder Social home page Coder Social logo

Comments (3)

njugray avatar njugray commented on May 1, 2024

没有上述用法
如果只需要客户端渲染, 可以把渲染过程放在 componentDidMount 生命周期之后.

上述的代码看起来是 dynamic import 的用法, 服务端渲染都是同步的. 如果只是语法上的支持, 可以尝试自定义配置babel插件

from beidou.

yangchongduo avatar yangchongduo commented on May 1, 2024

如何把渲染 放在 componentDidMount ?
如果 require 一个包 有window 对象就报错,怎么处理?

from beidou.

njugray avatar njugray commented on May 1, 2024

如何把渲染 放在 componentDidMount ?

把异步操作丢到 componentDidMount 里就可以了.

如果 require 一个包 有window 对象就报错,怎么处理?

北斗里默认加入了BOM的polyfill的, 绝大多数情况下, 代码里使用 window, document等, 是不会报错的, 你可以排查下报错的代码, 如果是 node的 global 没有的变量使用导致报错, 可以自行 polyfill

from beidou.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.