警告:样式化组件上的未知道具

时间:2017-11-10 14:05:24

标签: javascript reactjs

我是样式组件的新手,我有以下问题。

假设我有以下组件:

model friction
  //constants
  parameter Real muk = 0.2;
  parameter Real mus = 0.3;
  parameter Real m1 = 1.0;
  parameter Real m2 = 2.0;
  parameter Real m3 = 3.0;
  parameter Real Fn12 = 3.0;
  parameter Real Fn23 = 2.0;
  parameter Real absTol = 0.1;
  //variables
  Real X1, X2, X3, V1, V2, V3, A1, A2, A3, F1, F2, F3, Ff12, Ff23, Fs12, Fs23;

initial equation
  X1 = 0;
  X2 = 0;
  X3 = 0;
  V1 = 0;
  V2 = 0;
  V3 = 0;
equation
  F1 = 2 * sin(5 * time);
  F2 = 2 * sin(7 * time);
  F3 = 3 * sin(11 * time);
  V1 = der(X1);
  V2 = der(X2);
  V3 = der(X3);
  A1 = der(V1);
  A2 = der(V2);
  A3 = der(V3);
  m1 * A1 = F1 - Ff12;
  m2 * A2 = F2 + Ff12 - Ff23;
  m3 * A3 = F3 + Ff23;
  Fs12 = (m2 * F1 - m1 * (F2-Ff23)) / (m1 + m2);
  Fs23 = (m3 * (F2 + Ff12) - m2 * F3) / (m2 + m3);

  if abs(V1 - V2) < absTol and abs(Fs12) < mus * Fn12 then
    Ff12 = Fs12;
  else
    Ff12 = muk * Fn12 * sign(V1 - V2);
  end if;

  if abs(V3 - V2) < absTol and abs(Fs23) < mus * Fn23 then
    Ff23 = Fs23;
  else
    Ff23 = muk * Fn23 * sign(V2 - V3);
  end if;


end friction;

现在,当我在故事书或其他地方使用此组件时,我收到以下警告:

warning.js:33警告:标记上有未知道具const NavigationBar = Content.withComponent(Flex).extend` display: flex; flex-direction: row; padding: 0 24px; height: ${switchProp('size', { s: '40px', m: '50px', l: '70px', })}; ${Text} { align-self: center; justify-self: center; color: ${prop('theme.colors.navigation-text', '#000')}; } ${H1}, ${H2}, ${H3}, ${H4}, ${H5}, ${H6}{ color: #1474A4; padding: 0 24px; align-self: center; color: ${prop('theme.colors.navigation-text', '#000')}; } `; export default NavigationBar; primarynavigation。从元素中删除这些道具......

我在https://reactjs.org/warnings/unknown-prop.html上阅读了文档,但我真的无法修复或找到修复方法。你能给我任何意见吗?

0 个答案:

没有答案